1
0
Fork 0
mirror of https://github.com/tmrts/go-patterns.git synced 2025-04-02 20:56:12 +03:00

add return type

This commit is contained in:
hechen0 2019-01-16 23:31:22 +08:00
parent f978e42036
commit 6b446c3fbc

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