diff --git a/telegram_bot/telegram_bot.go b/telegram_bot/telegram_bot.go index bd870af0..66369676 100644 --- a/telegram_bot/telegram_bot.go +++ b/telegram_bot/telegram_bot.go @@ -199,9 +199,9 @@ func CloseConnection() { err := CloseConnection_err() if err != nil { - log.Error("Postgres gorm CloseConnection() error: ", err) + log.Error("Telegram bot CloseConnection() error: ", err) } else { - log.Info("Postgres gorm connection closed") + log.Info("Telegram bot connection closed") } return diff --git a/telegram_client/telegram_client.go b/telegram_client/telegram_client.go index ce2caa8d..ee2d67b3 100644 --- a/telegram_client/telegram_client.go +++ b/telegram_client/telegram_client.go @@ -773,6 +773,8 @@ func WaitStop() { // CloseConnection - остановка работы клиента Телеграм func CloseConnection() { + var err error + if stopTelegramFunc != nil { err := stopTelegramFunc() if err != nil { @@ -780,6 +782,12 @@ func CloseConnection() { } } + if err != nil { + log.Error("Telegram client CloseConnection() error: ", err) + } else { + log.Info("Telegram client connection closed") + } + } // FloodWait sleeps required duration and returns true if err is FLOOD_WAIT