Use a signal to close the longpolls on shutdown

This commit is contained in:
Juan Font Alonso 2022-06-23 19:40:07 +02:00
parent d404ba102d
commit 39b58f7d4c
2 changed files with 12 additions and 0 deletions

View file

@ -572,6 +572,13 @@ func (h *Headscale) PollNetMapStream(
// The connection has been closed, so we can stop polling.
return
case <-h.shutdownChan:
log.Info().
Str("handler", "PollNetMapStream").
Str("machine", machine.Hostname).
Msg("The long-poll handler is shutting down")
return
}
}
}