TsgcWSCircuitBreakerMethods › Reset

Reset Method

Clears the state, rolling-window counters and last-success payload for a single key.

Syntax

procedure Reset(const aKey: string);

Parameters

NameTypeDescription
aKeyconst stringCircuit key to reset — usually the hostname of the upstream service.

Remarks

Clears the per-key rolling-window counters, resets the state back to Closed and drops any cached last-success payload held for Fallback.UseLastSuccess. Aggregate Metrics counters are not affected — use ResetAll to zero them too. OnStateChange fires when the key was not already Closed. Typical use: after correcting a configuration or after a known-transient incident ends, reset the affected key so it starts fresh without waiting for the rolling window to expire.

Example

// Incident for api.openai.com is resolved — start from a clean slate
sgcWSCircuitBreaker1.Reset('api.openai.com');

Back to Methods