From 91464a7cb7e55cb73649d3450432840572e88dc6 Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 24 Aug 2026 11:52:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20fund=5Fflow=5Falert=E8=A1=A5=E6=BC=8F?= =?UTF-8?q?=E2=80=94=E2=80=94=E9=87=8D=E8=AF=84timeout120=E2=86=92300+name?= =?UTF-8?q?=E7=BC=BA=E5=A4=B1=E6=9F=A5stocks=E5=85=9C=E5=BA=95(=E9=9A=8F05?= =?UTF-8?q?1b56cd=E5=90=8C=E6=89=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/fund_flow_alert.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/fund_flow_alert.py b/deploy/profile-scripts/fund_flow_alert.py index 08a1ed6b..2b740b9d 100644 --- a/deploy/profile-scripts/fund_flow_alert.py +++ b/deploy/profile-scripts/fund_flow_alert.py @@ -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: