mirror of
https://github.com/juanfont/headscale.git
synced 2026-03-28 20:22:06 +01:00
Use a signal to close the longpolls on shutdown
This commit is contained in:
7
poll.go
7
poll.go
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user