From 7dd79d5f96c1956e347710734baf81f1e76acf5a Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Fri, 11 Aug 2023 15:24:14 +0200 Subject: [PATCH] Add a little bit more delay when spinning But we really shouldn't do it that way, if only because there's a race between the last write to the channel and the close() call --- dnscrypt-proxy/coldstart.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnscrypt-proxy/coldstart.go b/dnscrypt-proxy/coldstart.go index dbf075f3..d47a3750 100644 --- a/dnscrypt-proxy/coldstart.go +++ b/dnscrypt-proxy/coldstart.go @@ -23,7 +23,7 @@ type CaptivePortalHandler struct { func (captivePortalHandler *CaptivePortalHandler) Stop() { close(captivePortalHandler.cancelChannel) for len(captivePortalHandler.countChannel) < captivePortalHandler.channelCount { - time.Sleep(time.Millisecond) + time.Sleep(10 * time.Millisecond) } close(captivePortalHandler.countChannel) }