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
This commit is contained in:
Frank Denis 2023-08-11 15:24:14 +02:00
parent 5088d8fae1
commit 7dd79d5f96
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}