revert(34337fc5): 恢复被知微二次stale提交覆盖的昨晚重构——batch/per_stock/stale_detector/fix_gateway_port/candidate_filter 回滚至1e71a2d8版本;她提交中的运行时文件(db-shm/db-wal/price_history/market_scan_summary)移出跟踪;保留其morning_health_check小果清理

This commit is contained in:
hmo
2026-07-21 23:24:45 +08:00
parent da4112b430
commit 05a60cf0d4
10 changed files with 332 additions and 2543 deletions
+15 -7
View File
@@ -142,7 +142,7 @@ def main():
reassess_scripts.append(code)
print(f"[AUTO_REASSESS] {name}({code}) 价{cur_price:.2f}偏离买入区中心{center:.2f} {drift:+.0f}% → 触发重评")
if reassess_scripts:
# 调用 per_stock_reassess
# 调用 per_stock_reassess(每轮最多5只,防LLM慢导致整批超时;其余下轮继续)
reassess_path = None
for p in ['/home/hmo/MoFin/scripts/per_stock_reassess.py',
'/home/hmo/.hermes/profiles/position-analyst/scripts/per_stock_reassess.py']:
@@ -150,12 +150,20 @@ def main():
reassess_path = p
break
if reassess_path:
for code in reassess_scripts:
r = subprocess.run(['python3', reassess_path, code],
capture_output=True, text=True, timeout=60)
out = r.stdout.strip()[:200] if r.stdout else ""
err = r.stderr.strip()[:200] if r.stderr else ""
print(f"{code}: exited={r.returncode} {out}")
MAX_PER_RUN = 5
batch = reassess_scripts[:MAX_PER_RUN]
if len(reassess_scripts) > MAX_PER_RUN:
print(f"[AUTO_REASSESS] 本轮限{MAX_PER_RUN}只,剩余{len(reassess_scripts)-MAX_PER_RUN}只下轮继续")
for code in batch:
try:
# LLM 重评冷启动 20-100sdeepseek-v4-pro 更慢 → 480s
r = subprocess.run(['python3', reassess_path, code],
capture_output=True, text=True, timeout=480)
out = r.stdout.strip()[:200] if r.stdout else ""
err = r.stderr.strip()[:200] if r.stderr else ""
print(f"{code}: exited={r.returncode} {out}")
except subprocess.TimeoutExpired:
print(f"{code}: 超时480s(LLM仍慢),下轮重试")
except Exception as e:
print(f"[AUTO_REASSESS FAIL] {e}")
# ----- 结束 自选股重评 -----