Skip to content

Commit

Permalink
bug: ensure pending close flag is reset
Browse files Browse the repository at this point in the history
  • Loading branch information
lance committed Dec 20, 2016
1 parent cc2c01a commit 35b5be1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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');
Expand Down

0 comments on commit 35b5be1

Please sign in to comment.