修复模拟盘卖币握锁导致 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
View File
@@ -336,6 +336,12 @@ def notify_options_close(
trade_id=head.get("id") if len(rows) == 1 else None,
premium_ccy=ccy,
)
# 推送企业微信前先提交,避免握锁等待 webhook(可达数秒)导致卖币/快照 database is locked
if conn is not None:
try:
conn.commit()
except Exception:
pass
ok = notify_options_send(cfg, msg)
if ok and conn is not None:
for r in pending or rows: