Skip to content

Commit

Permalink
fixed bug with success threshold always passing
Browse files Browse the repository at this point in the history
  • Loading branch information
nrktkt committed Mar 19, 2016
1 parent b61808c commit d41b631
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/black/door/breaker/Breaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,10 @@ public void fail(){
protected void succeed(){
switch (state){
case CLOSED:
if(successes.incrementAndGet() >= successThreshold)
if(successes.incrementAndGet() >= successThreshold){
failures.set(0);
successes.set(0);
}
break;
case HALF_OPEN:
if(successes.incrementAndGet() >= successThreshold){
Expand Down

0 comments on commit d41b631

Please sign in to comment.