fix: reduce long-poll timeout to 2s, make mark_as_seen async to unblock TG sender
This commit is contained in:
1 parent
c940a456bc
commit
c26d8aa294
2 files changed
+11
-5
No files matched your search
+2
-2
@@ -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()
|
||||
|
||||