perf: reduce poll timeout to 1s and wait to 50ms for faster button response

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

View File

@@ -86,7 +86,7 @@ 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},
params={"offset": last_update_id, "timeout": 1},
timeout=10,
)
resp.raise_for_status()