fix(resilience): reset lastFailureTime on OPEN → CLOSED transition

Match reset() behavior — clear lastFailureTime when recovering from
OPEN state to avoid stale timestamps in persisted state.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
tombii
2026-04-02 22:42:13 +02:00
parent c0da968af2
commit afe72c8029

View File

@@ -203,6 +203,7 @@ export class CircuitBreaker {
this._transition(STATE.CLOSED);
this.failureCount = 0;
this.successCount = 0;
this.lastFailureTime = null;
} else if (this.state === STATE.HALF_OPEN) {
this.successCount++;
this._transition(STATE.CLOSED);