diff --git a/sentinel-core/circuitbreaker/error_circuit_breaker.cc b/sentinel-core/circuitbreaker/error_circuit_breaker.cc index a45534ee..4478499f 100644 --- a/sentinel-core/circuitbreaker/error_circuit_breaker.cc +++ b/sentinel-core/circuitbreaker/error_circuit_breaker.cc @@ -68,7 +68,7 @@ void ErrorCircuitBreaker::RecordAndHandleStateChange(const std::string& err) { double cur_value = strategy_ == Strategy::kErrorRatio ? err_count * 1.0 / total_count : err_count; - if (cur_value > threshold_) { + if (cur_value >= threshold_) { auto cs = current_state_.load(); switch (cs) { case State::kClosed: @@ -84,4 +84,4 @@ void ErrorCircuitBreaker::RecordAndHandleStateChange(const std::string& err) { } } // namespace CircuitBreaker -} // namespace Sentinel \ No newline at end of file +} // namespace Sentinel