fix: 扫描器幂等检查误伤——watchlist回归池不算扫描产出

- watchlist_auto_exit回归池硬编码sector='v_mr', 污染幂等检查
- 导致ADX在甜区(28.2)时v_weak整天被误判'已扫过'而跳过
- 幂等收紧为只认扫描器自己的reason格式(v_weak/v_mr精选/S2恐慌买)
This commit is contained in:
xxm
2026-08-06 00:25:06 +08:00
parent b5aed51924
commit aa85fc218e
2 changed files with 6 additions and 2 deletions
+4 -1
View File
@@ -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