From f73e7fe00563957a5d15f159da91b124f674aeb2 Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Mon, 14 Mar 2022 16:02:08 +0300 Subject: [PATCH] Add debug logs --- src/bots/manager/index.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/bots/manager/index.ts b/src/bots/manager/index.ts index f6c1422..b700d85 100644 --- a/src/bots/manager/index.ts +++ b/src/bots/manager/index.ts @@ -91,12 +91,21 @@ export default class BotsManager { const webhookInfo = await bot.telegram.getWebhookInfo(); const previousPendingUpdateCount = this.botsPeddingUpdateCount[state.id] || 0; + console.log("Check pending updates:", {state, webhookInfo}); + if (previousPendingUpdateCount !== 0 && webhookInfo.pending_update_count !== 0) { this._setWebhook(bot, state); } this.botsPeddingUpdateCount[state.id] = webhookInfo.pending_update_count; - } catch (e) {} + } catch (e) { + Sentry.captureException(e, { + extra: { + method: "_checkPendingUpdate", + state_id: state.id, + } + }); + } } static async _setWebhook(bot: Telegraf, state: BotState): Promise {