修复粉尘桥拦开仓,并继续消除模拟盘嵌套握锁导致的 database is locked。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-07 11:28:29 +08:00
parent 030b237981
commit ea3e029eb9
7 changed files with 196 additions and 33 deletions
+3
View File
@@ -335,6 +335,8 @@ def run_options_profit_exits(
continue
if state == "closing":
# 平仓/卖币会另开连接写库,先提交释放锁(模拟盘尤其敏感)
_commit(conn)
result = close_fn(inst_id)
if result.get("already_flat") or _result_fully_done(result):
_mark_state(conn, inst_id, "done")
@@ -369,6 +371,7 @@ def run_options_profit_exits(
if not profit_exit_hit(premium_paid=prem, recycle_usdc=recycle, mult=mult):
continue
_commit(conn)
result = close_fn(inst_id)
if result.get("already_flat"):
_mark_state(conn, inst_id, "done")