Skip to content

Commit

Permalink
bug: correct max failures check
Browse files Browse the repository at this point in the history
  • Loading branch information
Máté Czapáry authored and lance committed Dec 6, 2018
1 parent b6ae188 commit 1ecb9ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/circuit.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ function fail (circuit, err, args, latency) {
if (stats.fires < circuit.volumeThreshold) return;
const errorRate = stats.failures / stats.fires * 100;
if (errorRate > circuit.options.errorThresholdPercentage ||
circuit.options.maxFailures >= stats.failures ||
stats.failures >= circuit.options.maxFailures ||
circuit.halfOpen) {
circuit.open();
}
Expand Down

0 comments on commit 1ecb9ca

Please sign in to comment.