From a0b38972787947fc9dbf5e1e9fc6539213a998ce Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 21 Nov 2023 23:54:27 +0000 Subject: [PATCH] Cap link backoff at roughly 4.5 hours --- src/core/link.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/link.go b/src/core/link.go index f2abd7c6..0f445ff5 100644 --- a/src/core/link.go +++ b/src/core/link.go @@ -235,7 +235,9 @@ func (l *links) add(u *url.URL, sintf string, linkType linkType) error { // The caller should check the return value to decide whether // or not to give up trying. backoffNow := func() bool { - backoff++ + if backoff < 14 { // Cap at roughly 4.5 hours maximum. + backoff++ + } duration := time.Second * time.Duration(math.Exp2(float64(backoff))) select { case <-state.kick: