fix: add error logging for send_thinking failures in email poller
This commit is contained in:
4
main.py
4
main.py
@@ -58,7 +58,9 @@ def _email_poller(cfg):
|
|||||||
try:
|
try:
|
||||||
tg_msg_id = send_thinking(cfg.telegram, cfg.telegram.chat_id,
|
tg_msg_id = send_thinking(cfg.telegram, cfg.telegram.chat_id,
|
||||||
f"📥 *获取邮件中…*\n{_mail_label(mail)}")
|
f"📥 *获取邮件中…*\n{_mail_label(mail)}")
|
||||||
except Exception:
|
logger.info(" 获取邮件中消息已发送: msg_id=%d", tg_msg_id)
|
||||||
|
except Exception as e:
|
||||||
|
logger.error(" 获取邮件中消息发送失败: %s", e)
|
||||||
tg_msg_id = 0
|
tg_msg_id = 0
|
||||||
_email_queue.put((acct_idx, mail, tg_msg_id))
|
_email_queue.put((acct_idx, mail, tg_msg_id))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ 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": 5, "allowed_updates": ["callback_query", "message"]},
|
params={"offset": last_update_id, "timeout": 5},
|
||||||
timeout=15,
|
timeout=15,
|
||||||
)
|
)
|
||||||
resp.raise_for_status()
|
resp.raise_for_status()
|
||||||
|
|||||||
Reference in New Issue
Block a user