fix: fund_flow_alert补漏——重评timeout120→300+name缺失查stocks兜底(随051b56cd同批)

This commit is contained in:
xxm
2026-08-24 11:52:54 +08:00
parent 051b56cdd6
commit 91464a7cb7
+11 -2
View File
@@ -98,7 +98,16 @@ def process_flow_alerts(all_flows):
if not alerts:
continue
name = data.get("name", code)
name = data.get("name") or ""
if not name: # 2026-08-24 名称兜底:资金流数据无name时查stocks(红线13:不得以code冒充name)
try:
import sqlite3 as _sq3
_nc = _sq3.connect("/home/hmo/MoFin/data/mofin.db", timeout=5)
_nr = _nc.execute("SELECT name FROM stocks WHERE code=?", (code,)).fetchone()
_nc.close()
name = _nr[0] if _nr and _nr[0] and _nr[0] != code else code
except Exception:
name = code
pattern = analysis.get("pattern", "")
trend = analysis.get("trend", "")
@@ -166,7 +175,7 @@ def _trigger_holding_reassess(alerts):
try:
r = subprocess.run(
[sys.executable, str(_SCRIPT_DIR / "per_stock_reassess.py"), code],
capture_output=True, text=True, timeout=120, cwd=str(_SCRIPT_DIR),
capture_output=True, text=True, timeout=300, cwd=str(_SCRIPT_DIR), # 2026-08-24 120→300(LLM12维实测104-200s,120必超时)
)
reassess_out = (r.stdout or "").strip()[-500:] if r.stdout else "无输出"
except Exception as e: