Skip to content

Commit

Permalink
Merge 119079d into 1558d48
Browse files Browse the repository at this point in the history
  • Loading branch information
jdef committed Aug 31, 2018
2 parents 1558d48 + 119079d commit 5502ced
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/v1/lib/backoff/backoff.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ func Notifier(minWait, maxWait time.Duration, until <-chan struct{}) <-chan stru
d = maxWait
}
limiter = nil
// drain the timer to avoid Reset problems
if !t.Stop() {
<-t.C
}
case <-t.C:
if limiter != nil {
d /= 2
Expand All @@ -82,7 +86,7 @@ func Notifier(minWait, maxWait time.Duration, until <-chan struct{}) <-chan stru
return
}
// important to have non-zero minWait otherwise we busy-loop
if d == 0 {
if d < minWait {
d = minWait
}
t.Reset(d)
Expand Down

0 comments on commit 5502ced

Please sign in to comment.