diff --git a/deploy/profile-scripts/mr_scanner.py b/deploy/profile-scripts/mr_scanner.py index 22e4c3d1..da1b9240 100644 --- a/deploy/profile-scripts/mr_scanner.py +++ b/deploy/profile-scripts/mr_scanner.py @@ -356,8 +356,11 @@ def main(): _conn = _sq.connect(str(DB_PATH), timeout=5) try: _today = datetime.now().strftime("%Y-%m-%d") + # 幂等只认扫描器自己写的候选(reason以v_weak/v_mr精选开头) + # —— watchlist_auto_exit 回归池也写 sector='v_mr',不能算数(2026-08-05 bug修复) _n = _conn.execute( - "SELECT COUNT(*) FROM candidates WHERE sector='v_mr' AND substr(created_at,1,10)=?", + "SELECT COUNT(*) FROM candidates WHERE sector='v_mr' AND substr(created_at,1,10)=?" + " AND (reason LIKE 'v_weak%' OR reason LIKE 'v_mr精选%')", (_today,)).fetchone()[0] except Exception: _n = 0 diff --git a/deploy/profile-scripts/s2_scanner.py b/deploy/profile-scripts/s2_scanner.py index 50c26cdc..19699440 100644 --- a/deploy/profile-scripts/s2_scanner.py +++ b/deploy/profile-scripts/s2_scanner.py @@ -164,7 +164,8 @@ def main(): try: _today = datetime.now().strftime("%Y-%m-%d") _n = conn.execute( - "SELECT COUNT(*) FROM candidates WHERE sector='s2_panic' AND substr(created_at,1,10)=?", + "SELECT COUNT(*) FROM candidates WHERE sector='s2_panic' AND substr(created_at,1,10)=?" + " AND reason LIKE 'S2恐慌买%'", (_today,)).fetchone()[0] except Exception: _n = 0