1
0
mirror of https://github.com/ManyakRus/starter.git synced 2024-11-24 08:52:34 +02:00

сделал //Client = nil

This commit is contained in:
Nikitin Aleksandr 2024-11-14 09:56:40 +03:00
parent cd1b4921f8
commit ee88fc6441
2 changed files with 10 additions and 2 deletions

View File

@ -199,9 +199,9 @@ func CloseConnection() {
err := CloseConnection_err() err := CloseConnection_err()
if err != nil { if err != nil {
log.Error("Postgres gorm CloseConnection() error: ", err) log.Error("Telegram bot CloseConnection() error: ", err)
} else { } else {
log.Info("Postgres gorm connection closed") log.Info("Telegram bot connection closed")
} }
return return

View File

@ -773,6 +773,8 @@ func WaitStop() {
// CloseConnection - остановка работы клиента Телеграм // CloseConnection - остановка работы клиента Телеграм
func CloseConnection() { func CloseConnection() {
var err error
if stopTelegramFunc != nil { if stopTelegramFunc != nil {
err := stopTelegramFunc() err := stopTelegramFunc()
if err != nil { 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 // FloodWait sleeps required duration and returns true if err is FLOOD_WAIT