Migrate to JobBackOff

This commit is contained in:
Emile Vauge 2016-08-19 14:24:09 +02:00
parent 95e8f0a31e
commit d340ccd601
No known key found for this signature in database
GPG key ID: D808B4C167352E59
10 changed files with 30 additions and 72 deletions

View file

@ -9,10 +9,9 @@ import (
"fmt"
"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/emilevauge/backoff"
"github.com/mesos/mesos-go/detector"
_ "github.com/mesos/mesos-go/detector/zoo" // Registers the ZK detector
"github.com/mesosphere/mesos-dns/detect"
@ -111,7 +110,7 @@ func (provider *Mesos) Provide(configurationChan chan<- types.ConfigMessage, poo
notify := func(err error, time time.Duration) {
log.Errorf("mesos 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 {
log.Errorf("Cannot connect to mesos server %+v", err)
}