1
0
mirror of https://github.com/tmrts/go-patterns.git synced 2024-11-22 13:06:09 +03:00

Update circuit-breaker.md

This commit is contained in:
ty-l 2018-10-17 15:35:40 +08:00 committed by GitHub
parent f978e42036
commit 55615d2cdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,7 +67,7 @@ func Breaker(c Circuit, failureThreshold uint32) Circuit {
return func(ctx context) error {
if cnt.ConsecutiveFailures() >= failureThreshold {
canRetry := func(cnt Counter) {
canRetry := func(cnt Counter) bool {
backoffLevel := Cnt.ConsecutiveFailures() - failureThreshold
// Calculates when should the circuit breaker resume propagating requests