From da1b266350fac6ce1fce719de7b5456e8cd3e2bc Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Wed, 15 Jul 2026 18:51:04 +0800 Subject: [PATCH] fix: increase Telegram long-poll timeout to 5s and HTTP timeout to 15s --- src/tg_bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tg_bot.py b/src/tg_bot.py index 33fcb00..d5c6726 100644 --- a/src/tg_bot.py +++ b/src/tg_bot.py @@ -86,8 +86,8 @@ def poll_telegram(tg_cfg: TelegramConfig, cfg: Config, last_update_id: int) -> i try: resp = requests.get( f"https://api.telegram.org/bot{tg_cfg.bot_token}/getUpdates", - params={"offset": last_update_id, "timeout": 2, "allowed_updates": ["callback_query", "message"]}, - timeout=5, + params={"offset": last_update_id, "timeout": 5, "allowed_updates": ["callback_query", "message"]}, + timeout=15, ) resp.raise_for_status() data = resp.json()