1

Fix shutdown, fix broken announces

This commit is contained in:
2019-01-09 03:24:12 +04:00
parent 7612ce778f
commit dca290beb1
4 changed files with 16 additions and 10 deletions

View File

@@ -78,14 +78,14 @@ func Connect() {
log.Debug().Msg("Connection with Telegram established")
for update := range rawUpdates {
log.Debug().Msgf("Update of type %s received", update.Data["@type"])
<-c.ShutdownDone
return
}
}
// Shutdown disconnects from Telegram
func Shutdown() {
_, err := client.Destroy()
if err != nil {
log.Error().Err(err).Msg("Failed to destroy Telegram client instance")
}
client.DestroyInstance()
log.Info().Msg("Connection with Telegram closed")
}