From 0ec2048bc57d2018188373c42b08ad244ba40b60 Mon Sep 17 00:00:00 2001 From: Zichao Lin Date: Mon, 13 Jul 2026 07:49:09 +0800 Subject: [PATCH] fix: never discard from _processing_uids to prevent re-fetching --- main.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/main.py b/main.py index 19db78c..158ddd9 100644 --- a/main.py +++ b/main.py @@ -110,19 +110,16 @@ def _tg_worker(cfg): try: info = _tg_queue.get_nowait() tg_send_and_mark(cfg, info) - # 发送并标记已读成功后才移除 pending + # 发送并标记已读成功后移除 pending(_processing_uids 保留直到重启) with _pending_lock: _pending_uids.discard(info["uid"]) - _processing_uids.discard(info["uid"]) except queue_module.Empty: break except Exception as e: logger.error(f"TG 发送失败: {e}", exc_info=True) - # 发送失败也要移除 pending,避免永久阻塞 try: with _pending_lock: _pending_uids.discard(info["uid"]) - _processing_uids.discard(info["uid"]) except Exception: pass