Browse Source

retry for all errors

pull/3472/head
chrislu 2 years ago
parent
commit
f7e0a65e75
  1. 4
      weed/util/retry.go

4
weed/util/retry.go

@ -23,11 +23,11 @@ func Retry(name string, job func() error) (err error) {
if strings.Contains(err.Error(), "transport") { if strings.Contains(err.Error(), "transport") {
hasErr = true hasErr = true
glog.V(0).Infof("retry %s: err: %v", name, err) glog.V(0).Infof("retry %s: err: %v", name, err)
time.Sleep(waitTime)
waitTime += waitTime / 2
} else { } else {
break break
} }
time.Sleep(waitTime)
waitTime += waitTime / 2
} }
return err return err
} }

Loading…
Cancel
Save