TsgcWSCircuitBreaker › Properties › Recovery
Half-open retry policy that governs how an Open circuit transitions back to Closed.
property Recovery: TsgcCircuitBreakerRecovery read FRecovery
write SetRecovery;
—
After the circuit opens, the breaker stays in the Open state for CooldownSec seconds and rejects every call. Once the cooldown elapses it transitions to HalfOpen and lets HalfOpenTrialCalls probe calls through; if they succeed the circuit closes, if any fails it re-opens and the cooldown timer restarts. Sub-properties: CooldownSec (seconds before transitioning Open -> HalfOpen, default 30), HalfOpenTrialCalls (trial calls allowed in HalfOpen, default 1), AutoReset (clears counters automatically on state transitions, default True) and MaxRetries (informational ceiling consumed by retry helpers; the breaker itself does not retry automatically, default 3). Longer cooldowns protect a struggling upstream from a premature wave of traffic; shorter cooldowns recover faster for services that only flicker.
// After opening: wait 30s, then allow 1 trial call, then decide
sgcWSCircuitBreaker1.Recovery.CooldownSec := 30;
sgcWSCircuitBreaker1.Recovery.HalfOpenTrialCalls := 1;
sgcWSCircuitBreaker1.Recovery.AutoReset := True;
sgcWSCircuitBreaker1.Recovery.MaxRetries := 3;