1

Try to terminal all goroutines at shutdown gracefully

This commit is contained in:
Vladimir Hodakov 2019-01-09 15:48:34 +04:00
parent dca290beb1
commit f240def745
Signed by: Vladimir Hodakov
GPG Key ID: 673980B6882F82C6

View File

@ -24,6 +24,7 @@ func ZookeeperReceiver(client *tdlib.Client) {
receiver := client.AddEventReceiver(&tdlib.UpdateNewMessage{}, fwMessagesFilter, 5)
log.Debug().Msg("Receiver added")
go func() {
for newMsg := range receiver.Chan {
updateMsg := (newMsg).(*tdlib.UpdateNewMessage)
// Check if message text contains needed battle data
@ -74,4 +75,5 @@ func ZookeeperReceiver(client *tdlib.Client) {
<-c.ShutdownDone
return
}
}()
}