diff --git a/pkg/network/retry.go b/pkg/network/retry.go index 0498b7db..9fb706dc 100644 --- a/pkg/network/retry.go +++ b/pkg/network/retry.go @@ -13,14 +13,7 @@ func NewRetry() Retry { return Retry{t: retry} } -func (r *Retry) Fail() *Retry { r.fail = true; time.Sleep(r.t); return r } -func (r *Retry) Failed() bool { return r.fail } -func (r *Retry) Multiply(x int) { r.t *= time.Duration(x) } -func (r *Retry) SuccessCheck() { - if r.fail { - return - } - r.t = retry - r.fail = false -} +func (r *Retry) Fail() *Retry { r.fail = true; time.Sleep(r.t); return r } +func (r *Retry) Multiply(x int) { r.t *= time.Duration(x) } +func (r *Retry) Success() { r.t = retry; r.fail = false } func (r *Retry) Time() time.Duration { return r.t } diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go index 505a55d2..00a358aa 100644 --- a/pkg/worker/worker.go +++ b/pkg/worker/worker.go @@ -126,7 +126,7 @@ func (w *Worker) Start(done chan struct{}) { w.cord.SendLibrary(w) w.cord.SendPrevSessions(w) <-wait - retry.SuccessCheck() + retry.Success() } } }()