TsgcWSRateLimiterMethods › Reset

Reset Method

Clears the counters for a single key.

Syntax

procedure Reset(const aKey: string);

Parameters

NameTypeDescription
aKeyconst stringRate-limit key whose counters should be cleared. Must exactly match the key previously used with IsAllowed / Consume.

Remarks

Clears the Token Bucket, Sliding Window, Fixed Window, burst tracker and connection counter for just this key. The next call for aKey starts from a fresh state (full bucket, empty windows). Typical use is to forgive a client after manual review, to drop a stale entry from the internal tables, or inside an admin UI that exposes a "Reset" button per key. Quota counters are shared across keys by period and are not reset by this method — they only reset at the start of each calendar period.

Example

// Forgive a client that has been manually reviewed
sgcWSRateLimiter1.Reset('apikey:' + ApiKey);

Back to Methods