forked from Ivasoft/traefik
Add support for specifying the name of the endpoint.
This commit is contained in:
committed by
Traefiker Bot
parent
2eb651645d
commit
9eb02d9b03
11
vendor/github.com/cenk/backoff/context.go
generated
vendored
11
vendor/github.com/cenk/backoff/context.go
generated
vendored
@@ -1,9 +1,8 @@
|
||||
package backoff
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
// BackOffContext is a backoff policy that stops retrying after the context
|
||||
@@ -52,9 +51,13 @@ func (b *backOffContext) Context() context.Context {
|
||||
|
||||
func (b *backOffContext) NextBackOff() time.Duration {
|
||||
select {
|
||||
case <-b.Context().Done():
|
||||
case <-b.ctx.Done():
|
||||
return Stop
|
||||
default:
|
||||
return b.BackOff.NextBackOff()
|
||||
}
|
||||
next := b.BackOff.NextBackOff()
|
||||
if deadline, ok := b.ctx.Deadline(); ok && deadline.Sub(time.Now()) < next {
|
||||
return Stop
|
||||
}
|
||||
return next
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user