fix: reduce long-poll timeout to 2s, make mark_as_seen async to unblock TG sender

This commit is contained in:
2026-07-15 19:15:27 +08:00
parent c940a456bc
commit c26d8aa294
2 changed files with 11 additions and 5 deletions

View File

@@ -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": 5},
timeout=15,
params={"offset": last_update_id, "timeout": 2},
timeout=10,
)
resp.raise_for_status()
data = resp.json()