From 034eed0ada231d6093e281b2ea08266711e6cff2 Mon Sep 17 00:00:00 2001 From: Adam Fisk Date: Fri, 22 Nov 2024 09:24:28 -0700 Subject: [PATCH] tweak select --- dialer/fastconnect.go | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dialer/fastconnect.go b/dialer/fastconnect.go index 99205d788..1f473687f 100644 --- a/dialer/fastconnect.go +++ b/dialer/fastconnect.go @@ -117,8 +117,6 @@ func (fcd *fastConnectDialer) connectAll(dialers []ProxyDialer) { // Loop until we're connected if len(fcd.connected.dialers) < 2 { fcd.parallelDial(dialers) - // Add jitter to avoid thundering herd - time.Sleep(time.Duration(rand.Intn(4000)) * time.Millisecond) } else { break } @@ -126,8 +124,7 @@ func (fcd *fastConnectDialer) connectAll(dialers []ProxyDialer) { case <-fcd.stopCh: log.Debug("Stopping parallel dialing") return - default: - + case <-time.After(time.Duration(rand.Intn(4000)) * time.Millisecond): } } // At this point, we've tried all of the dialers, and they've all either