修复币本位平仓/到期后未自动卖回,并消除模拟盘卖币时数据库锁定。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-07 10:47:25 +08:00
parent 474e0742f7
commit 265317672c
6 changed files with 156 additions and 4 deletions
+5 -1
View File
@@ -1607,8 +1607,12 @@ def _purge_key_monitors_if_full_margin():
def get_db():
conn = sqlite3.connect(DB_PATH)
conn = sqlite3.connect(DB_PATH, timeout=30)
conn.row_factory = sqlite3.Row
try:
conn.execute("PRAGMA busy_timeout=30000")
except Exception:
pass
return conn