diff --git a/main.py b/main.py index eccbefd..7c9a038 100644 --- a/main.py +++ b/main.py @@ -110,7 +110,7 @@ def _tg_poller(cfg): except Exception as e: logger.error(f"TG 轮询错误: {e}", exc_info=True) if _running: - _shutdown_event.wait(0.1) + _shutdown_event.wait(0.05) def _tg_sender(cfg): diff --git a/src/tg_bot.py b/src/tg_bot.py index 34ddd6c..4b7611d 100644 --- a/src/tg_bot.py +++ b/src/tg_bot.py @@ -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()