mirror of
https://github.com/tmrts/go-patterns.git
synced 2024-11-25 14:36:06 +03:00
Update circuit-breaker.md
This commit is contained in:
parent
f978e42036
commit
55615d2cdf
@ -67,7 +67,7 @@ func Breaker(c Circuit, failureThreshold uint32) Circuit {
|
|||||||
|
|
||||||
return func(ctx context) error {
|
return func(ctx context) error {
|
||||||
if cnt.ConsecutiveFailures() >= failureThreshold {
|
if cnt.ConsecutiveFailures() >= failureThreshold {
|
||||||
canRetry := func(cnt Counter) {
|
canRetry := func(cnt Counter) bool {
|
||||||
backoffLevel := Cnt.ConsecutiveFailures() - failureThreshold
|
backoffLevel := Cnt.ConsecutiveFailures() - failureThreshold
|
||||||
|
|
||||||
// Calculates when should the circuit breaker resume propagating requests
|
// Calculates when should the circuit breaker resume propagating requests
|
||||||
|
Loading…
Reference in New Issue
Block a user