Migrate to JobBackOff
This commit is contained in:
parent
95e8f0a31e
commit
d340ccd601
10 changed files with 30 additions and 72 deletions
|
@ -10,12 +10,11 @@ import (
|
|||
"errors"
|
||||
"github.com/BurntSushi/ty/fun"
|
||||
log "github.com/Sirupsen/logrus"
|
||||
"github.com/cenkalti/backoff"
|
||||
"github.com/containous/traefik/safe"
|
||||
"github.com/containous/traefik/types"
|
||||
"github.com/containous/traefik/utils"
|
||||
"github.com/docker/libkv"
|
||||
"github.com/docker/libkv/store"
|
||||
"github.com/emilevauge/backoff"
|
||||
)
|
||||
|
||||
// Kv holds common configurations of key-value providers.
|
||||
|
@ -76,7 +75,7 @@ func (provider *Kv) watchKv(configurationChan chan<- types.ConfigMessage, prefix
|
|||
notify := func(err error, time time.Duration) {
|
||||
log.Errorf("KV connection error: %+v, retrying in %s", err, time)
|
||||
}
|
||||
err := utils.RetryNotifyJob(operation, backoff.NewExponentialBackOff(), notify)
|
||||
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Cannot connect to KV server: %v", err)
|
||||
}
|
||||
|
@ -106,7 +105,7 @@ func (provider *Kv) provide(configurationChan chan<- types.ConfigMessage, pool *
|
|||
notify := func(err error, time time.Duration) {
|
||||
log.Errorf("KV connection error: %+v, retrying in %s", err, time)
|
||||
}
|
||||
err := utils.RetryNotifyJob(operation, backoff.NewExponentialBackOff(), notify)
|
||||
err := backoff.RetryNotify(operation, backoff.NewJobBackOff(backoff.NewExponentialBackOff()), notify)
|
||||
if err != nil {
|
||||
return fmt.Errorf("Cannot connect to KV server: %v", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue