修复模拟盘卖币握锁导致 database is locked 与中控超时离线。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-07 11:04:06 +08:00
parent 066c90fd96
commit 80ef5ceccb
7 changed files with 173 additions and 126 deletions
+6 -11
View File
@@ -835,17 +835,12 @@ class SimBroker:
if margin_mode_from_inst_id(inst_id) == "coin":
uly = inst_id.split("-")[0].upper() if "-" in inst_id else "ETH"
conn_s = self.get_db()
try:
sell_residual_after_option_flat(
conn_s,
exchange,
underlying=uly,
inst_id=inst_id,
)
conn_s.commit()
finally:
conn_s.close()
sell_residual_after_option_flat(
self.get_db,
exchange,
underlying=uly,
inst_id=inst_id,
)
except Exception:
pass
settled.append(