From bb94930196ddf0e89da2a36b60b1d69514d7739b Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 15 Aug 2021 20:06:47 -0700 Subject: [PATCH] add some delays if error --- weed/util/retry.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weed/util/retry.go b/weed/util/retry.go index 569f8fda1..e1ad99d54 100644 --- a/weed/util/retry.go +++ b/weed/util/retry.go @@ -42,10 +42,10 @@ func RetryForever(name string, job func() error, onErrFn func(err error) bool) { if onErrFn(err) { if strings.Contains(err.Error(), "transport") { glog.V(0).Infof("retry %s: err: %v", name, err) - time.Sleep(waitTime) - if waitTime < RetryWaitTime { - waitTime += waitTime / 2 - } + } + time.Sleep(waitTime) + if waitTime < RetryWaitTime { + waitTime += waitTime / 2 } continue }