修复模拟盘卖币握锁导致 database is locked 与中控超时离线。
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-11
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user