mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-19 21:59:59 -08:00
Fix server registration keepalive.
This commit is contained in:
parent
2e3cc5cbf4
commit
190316b0a1
1 changed files with 2 additions and 1 deletions
|
|
@ -346,6 +346,7 @@ func (server *Server) UnlinkChannels(channel *Channel, other *Channel) {
|
||||||
// Important control channel messages are routed through this Goroutine
|
// Important control channel messages are routed through this Goroutine
|
||||||
// to keep server state synchronized.
|
// to keep server state synchronized.
|
||||||
func (server *Server) handler() {
|
func (server *Server) handler() {
|
||||||
|
regtick := time.Tick((3600 + ((server.Id * 60) % 600)) * 1e9)
|
||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
// Control channel messages
|
// Control channel messages
|
||||||
|
|
@ -381,7 +382,7 @@ func (server *Server) handler() {
|
||||||
|
|
||||||
// Server registration update
|
// Server registration update
|
||||||
// Tick every hour + a minute offset based on the server id.
|
// Tick every hour + a minute offset based on the server id.
|
||||||
case <-time.Tick((3600 + ((server.Id * 60) % 600)) * 1e9):
|
case <-regtick:
|
||||||
server.RegisterPublicServer()
|
server.RegisterPublicServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue