fix: promote调LLM子进程前先commit放锁——持写事务等per_stock_reassess(60-100s/只)=全库撞锁(今早开盘连环锁主嫌疑)

This commit is contained in:
xxm
2026-08-25 09:57:50 +08:00
parent 03e872dba0
commit ff93b4e723
@@ -182,6 +182,7 @@ def main():
# 数据异常:先重评(LLM算正确区间),成功则用正确区间,失败则跳过
print(f" ⚠️ {code} {name} 买入区{el}~{eh} 偏离现价{_dev:.0f}%(数据异常),先重评校准...", flush=True)
try:
conn.commit() # 2026-08-25 放锁:LLM子进程60-100s,持写锁等=全库撞锁(开盘连环撞锁主嫌疑)
_r = subprocess.run(["/home/hmo/MoFin/venv/bin/python",
"/home/hmo/MoFin/deploy/profile-scripts/per_stock_reassess.py", code],
capture_output=True, text=True, timeout=REASSESS_TIMEOUT)
@@ -270,6 +271,7 @@ def main():
if newly_added:
try:
import subprocess as _sp
conn.commit() # 2026-08-25 放锁:LLM子进程期间不持写锁
r = _sp.run(["python3", "/home/hmo/MoFin/deploy/profile-scripts/per_stock_reassess.py", code],
capture_output=True, text=True, timeout=REASSESS_TIMEOUT)
if r.returncode == 0: