From 5a1b70b888c7af3a25e63c94d67c930e2a38563b Mon Sep 17 00:00:00 2001 From: Lance Ball Date: Tue, 20 Dec 2016 17:04:04 -0500 Subject: [PATCH] fix: ensure pending close flag is reset --- lib/circuit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/circuit.js b/lib/circuit.js index 83ed894b..ad770488 100644 --- a/lib/circuit.js +++ b/lib/circuit.js @@ -70,6 +70,7 @@ class CircuitBreaker extends EventEmitter { */ close () { this[NUM_FAILURES] = 0; + this[PENDING_CLOSE] = false; if (this[STATE] !== CLOSED) { this[STATE] = CLOSED; this.emit('close'); @@ -82,6 +83,7 @@ class CircuitBreaker extends EventEmitter { * that has been provided. */ open () { + this[PENDING_CLOSE] = false; if (this[STATE] !== OPEN) { this[STATE] = OPEN; this.emit('open');