client: Don't try to reconnect with canceled context

This commit is contained in:
Toni Spets
2025-04-10 10:13:02 +03:00
parent 538f2a2ec0
commit a64a178dc3
+1 -1
View File
@@ -506,7 +506,7 @@ func (t *TelegramClient) Connect(ctx context.Context) {
}
go func() {
err = t.updatesManager.Run(t.clientCtx, t.client.API(), t.telegramUserID, updates.AuthOptions{})
if err != nil {
if err != nil && !errors.Is(err, context.Canceled) {
zerolog.Ctx(t.clientCtx).Err(err).Msg("failed to run updates manager")
t.Disconnect()
t.Connect(t.main.Bridge.Log.WithContext(context.Background()))