diff --git a/lib/redis_client/circuit_breaker.rb b/lib/redis_client/circuit_breaker.rb index af3c1a9..b5e6656 100644 --- a/lib/redis_client/circuit_breaker.rb +++ b/lib/redis_client/circuit_breaker.rb @@ -65,6 +65,8 @@ def protect def refresh_state now = RedisClient.now @lock.synchronize do + return unless @state == :open + if @errors.last < (now - @error_timeout) if @success_threshold > 0 @state = :half_open