diff --git a/pkg/connector/client.go b/pkg/connector/client.go index 6259ac2f..d9d9d6ee 100644 --- a/pkg/connector/client.go +++ b/pkg/connector/client.go @@ -541,16 +541,24 @@ func (t *TelegramClient) runInBackground(ctx context.Context) { log := zerolog.Ctx(ctx) err := t.client.Run(ctx, func(ctx context.Context) error { t.clientInitialized.Set() - log.Info().Msg("Client running starting updates") - return t.updatesManager.Run(ctx, t.client.API(), t.telegramUserID, updates.AuthOptions{ + log.Info().Msg("Client running, starting updates") + err := t.updatesManager.Run(ctx, t.client.API(), t.telegramUserID, updates.AuthOptions{ IsBot: t.metadata.IsBot, }) + if err != nil && !errors.Is(err, ctx.Err()) { + log.Warn().Err(err).Msg("Update manager exited with error") + } else { + log.Info().Msg("Update manager exited without error") + } + return err }) t.clientDone.Set() t.clientInitialized.Set() if err != nil { log.Err(err).Msg("Client exited with error") t.sendBadCredentialsOrUnknownError(err) + } else { + log.Debug().Msg("Client exited without error") } } diff --git a/pkg/gotd/telegram/updates/manager.go b/pkg/gotd/telegram/updates/manager.go index 8e56b525..2003db49 100644 --- a/pkg/gotd/telegram/updates/manager.go +++ b/pkg/gotd/telegram/updates/manager.go @@ -84,8 +84,8 @@ func (m *Manager) Run(ctx context.Context, api API, userID int64, opt AuthOption zap.Bool("is_bot", opt.IsBot), zap.Bool("forget", opt.Forget), ) - lg.Info("Starting update manager") - defer lg.Info("Update manager exiting") + lg.Debug("Starting update manager") + defer lg.Debug("Update manager exiting") wg, ctx := errgroup.WithContext(ctx)