fix: increase Telegram long-poll timeout to 5s and HTTP timeout to 15s
This commit is contained in:
@@ -86,8 +86,8 @@ def poll_telegram(tg_cfg: TelegramConfig, cfg: Config, last_update_id: int) -> i
|
|||||||
try:
|
try:
|
||||||
resp = requests.get(
|
resp = requests.get(
|
||||||
f"https://api.telegram.org/bot{tg_cfg.bot_token}/getUpdates",
|
f"https://api.telegram.org/bot{tg_cfg.bot_token}/getUpdates",
|
||||||
params={"offset": last_update_id, "timeout": 2, "allowed_updates": ["callback_query", "message"]},
|
params={"offset": last_update_id, "timeout": 5, "allowed_updates": ["callback_query", "message"]},
|
||||||
timeout=5,
|
timeout=15,
|
||||||
)
|
)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
data = resp.json()
|
data = resp.json()
|
||||||
|
|||||||
Reference in New Issue
Block a user