Try to gracefully stop all existing goroutines
This commit is contained in:
parent
f240def745
commit
86ddbb26f8
@ -24,7 +24,6 @@ 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
|
||||
@ -75,5 +74,4 @@ func ZookeeperReceiver(client *tdlib.Client) {
|
||||
<-c.ShutdownDone
|
||||
return
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
@ -73,6 +73,9 @@ func Authenticate() {
|
||||
func Connect() {
|
||||
go func() {
|
||||
announcesv1.ZookeeperReceiver(client)
|
||||
|
||||
<-c.ShutdownDone
|
||||
return
|
||||
}()
|
||||
rawUpdates := client.GetRawUpdatesChannel(100)
|
||||
log.Debug().Msg("Connection with Telegram established")
|
||||
|
Reference in New Issue
Block a user