Use a signal to close the longpolls on shutdown
This commit is contained in:
parent
d404ba102d
commit
39b58f7d4c
2 changed files with 12 additions and 0 deletions
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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue