remove check d >= 0 since go 1.8 is no longer supported on master branch

This commit is contained in:
lcfang 2018-03-13 15:22:30 +08:00
parent a7d6340ad2
commit 93aa73e492

View File

@ -128,9 +128,8 @@ func (r *rudimentaryErrorBackoff) OnError(error) {
r.lastErrorTimeLock.Lock()
defer r.lastErrorTimeLock.Unlock()
d := time.Since(r.lastErrorTime)
if d < r.minPeriod && d >= 0 {
if d < r.minPeriod {
// If the time moves backwards for any reason, do nothing
// TODO: remove check "d >= 0" after go 1.8 is no longer supported
time.Sleep(r.minPeriod - d)
}
r.lastErrorTime = time.Now()