修复模拟盘卖币握锁导致 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 -7
View File
@@ -573,16 +573,15 @@ def options_monitor_loop(
cfg=pe_cfg,
ex=pe_cfg.get("exchange_options"),
)
if sync_trades_fn is not None:
try:
conn.commit()
except Exception:
pass
sync_trades_fn(conn)
conn.commit()
finally:
conn.close()
# 币本位扫尾卖回:必须在监控连接关闭之后
# 同步/卖币必须在监控连接关闭之后
if sync_trades_fn is not None:
try:
sync_trades_fn(None)
except Exception:
pass
try:
pe_sell = dict(profit_exit_cfg or {})
pe_sell.setdefault("send_wechat", send_wechat)