diff --git a/yunke-server/scripts/scrape_via_page.py b/yunke-server/scripts/scrape_via_page.py index a8835dd..b91f62b 100644 --- a/yunke-server/scripts/scrape_via_page.py +++ b/yunke-server/scripts/scrape_via_page.py @@ -629,7 +629,10 @@ async def scrape_messages(cookie_str: str, max_conversations: int = 100, full_hi for pair in conversations: wm = watermarks.get(pair, 0) act = cust_activity.get(pair, 0) - if wm > 0 and act > 0 and act <= wm + 60_000: + # 注意:不能用 +60s 缓冲——若新消息恰好落在水位后 60s 内, + # act 永远 ≤ wm+60s → 每轮都跳过 → 该消息**永久漏掉**。 + # act==wm 表示云客最新消息==我们最新消息,精确相等才跳。 + if wm > 0 and act > 0 and act <= wm: skipped += 1 else: kept.append(pair) @@ -1586,7 +1589,10 @@ async def scrape_wa_messages(cookie_str: str, max_conversations: int = 100, full for pair in conversations: wm = watermarks.get(pair, 0) act = cust_activity.get(pair, 0) - if wm > 0 and act > 0 and act <= wm + 60_000: + # 注意:不能用 +60s 缓冲——若新消息恰好落在水位后 60s 内, + # act 永远 ≤ wm+60s → 每轮都跳过 → 该消息**永久漏掉**。 + # act==wm 表示云客最新消息==我们最新消息,精确相等才跳。 + if wm > 0 and act > 0 and act <= wm: skipped += 1 else: kept.append(pair)