Skip to content

Commit fab4914

Browse files
committed
Update comment
1 parent 03f1836 commit fab4914

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

library/agent/Context.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ export function runWithContext<T>(context: Context, fn: () => T) {
8686
return fn();
8787
}
8888

89-
// Reset the context
90-
// We should copy the context to avoid modifying the original object
91-
// For performance reasons, we don't copy the cache
89+
// `attackDetected`, `consumedRateLimitForIP` and `consumedRateLimitForUser`
90+
// are carried over if there's an existing context
91+
// Only in case of a top level context, we should reset them first
92+
// This is more for tests than for real usage
9293
delete context.cache;
9394
delete context.attackDetected;
9495
delete context.consumedRateLimitForIP;

0 commit comments

Comments
 (0)