IsOpen returns true if the circuit breaker is open (rejecting requests)
()
| 80 | |
| 81 | // IsOpen returns true if the circuit breaker is open (rejecting requests) |
| 82 | func (cb *CircuitBreaker) IsOpen() bool { |
| 83 | state := CircuitBreakerState(cb.state.Load()) |
| 84 | return state == CircuitBreakerOpen |
| 85 | } |
| 86 | |
| 87 | // shouldAttemptReset checks if enough time has passed to attempt reset |
| 88 | func (cb *CircuitBreaker) shouldAttemptReset() bool { |