Browse Source

add some delays if error

pull/2274/head
Chris Lu 3 years ago
parent
commit
bb94930196
  1. 8
      weed/util/retry.go

8
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
}

Loading…
Cancel
Save