don't expire backoffs until 2x backoff period

parent 1c0adc36
......@@ -196,7 +196,11 @@ func (db *DialBackoff) cleanup() {
for p, e := range db.entries {
good := false
for _, backoff := range e {
if now.Before(backoff.until) {
backoffTime := BackoffBase + BackoffCoef*time.Duration(backoff.tries*backoff.tries)
if backoffTime > BackoffMax {
backoffTime = BackoffMax
}
if now.Before(backoff.until.Add(backoffTime)) {
good = true
break
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment