修复粉尘桥拦开仓,并继续消除模拟盘嵌套握锁导致的 database is locked。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user