Skip to content

Commit

Permalink
Update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
hansott committed Jul 25, 2024
1 parent 03f1836 commit fab4914
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/agent/Context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ export function runWithContext<T>(context: Context, fn: () => T) {
return fn();
}

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

0 comments on commit fab4914

Please sign in to comment.