From 94387801180a8f1a53062a22a85969d57b6b27aa Mon Sep 17 00:00:00 2001 From: xxm Date: Mon, 17 Aug 2026 19:32:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=2012=E7=BB=B4=E6=8A=A5=E5=91=8A=E8=B5=84?= =?UTF-8?q?=E9=87=91=E6=B5=81/=E8=A1=8C=E4=B8=9A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=BA=90=E4=BF=AE=E5=A4=8D=20-=20capital=5Fflow=5Fcache?= =?UTF-8?q?=E8=AF=BB=E5=88=B0=E6=97=A7id=3D194(8-10)=E6=94=B9WHERE=20id=3D?= =?UTF-8?q?1(=E7=8E=B0=E5=9C=A833=E5=8F=AA)=20-=20batch=5Freassess?= =?UTF-8?q?=E8=A1=8C=E4=B8=9A=E5=9B=9E=E9=80=80stock=5Fsectors=5Fem(5061?= =?UTF-8?q?=E8=A6=86=E7=9B=96=E5=85=A8)=20=E6=A0=B9=E5=9B=A0:=20=E5=86=99?= =?UTF-8?q?=E5=85=A5=E5=9B=BA=E5=AE=9Aid=3D1=E4=BD=86=E8=AF=BB=E5=8F=96ORD?= =?UTF-8?q?ER=20BY=20id=20DESC=E6=8B=BF=E5=88=B0=E6=97=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/profile-scripts/batch_reassess.py | 2 +- deploy/profile-scripts/mofin_db.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/profile-scripts/batch_reassess.py b/deploy/profile-scripts/batch_reassess.py index 739e3313..b94ed8a2 100644 --- a/deploy/profile-scripts/batch_reassess.py +++ b/deploy/profile-scripts/batch_reassess.py @@ -191,7 +191,7 @@ def build_prompt(data): try: import sqlite3 as _sq, json as _j _db = _sq.connect("/home/hmo/MoFin/data/mofin.db") - _fr = _db.execute("SELECT cache_json FROM capital_flow_cache ORDER BY id DESC LIMIT 1").fetchone() + _fr = _db.execute("SELECT cache_json FROM capital_flow_cache WHERE id=1 ORDER BY updated_at DESC LIMIT 1").fetchone() if _fr and _fr[0]: _fc = _j.loads(_fr[0]) _stocks = _fc.get("stocks", {}) diff --git a/deploy/profile-scripts/mofin_db.py b/deploy/profile-scripts/mofin_db.py index effefd33..d1f6a186 100644 --- a/deploy/profile-scripts/mofin_db.py +++ b/deploy/profile-scripts/mofin_db.py @@ -2382,5 +2382,5 @@ def write_capital_flow_cache(conn, data: dict): def read_capital_flow_cache(conn) -> dict: import json - r = conn.execute("SELECT cache_json FROM capital_flow_cache ORDER BY id DESC LIMIT 1").fetchone() + r = conn.execute("SELECT cache_json FROM capital_flow_cache WHERE id=1 ORDER BY updated_at DESC LIMIT 1").fetchone() return json.loads(r['cache_json']) if r else {}