Fix server registration keepalive.

This commit is contained in:
Mikkel Krautz 2011-06-17 17:39:51 +02:00
parent 2e3cc5cbf4
commit 190316b0a1

View file

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