fix: avoid SQLite lock on fast position poll by skipping DB writes
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+5
-4
@@ -606,12 +606,13 @@ def check_monitors_locally(
|
||||
if not is_trading_session():
|
||||
return 0
|
||||
reconcile_monitors_without_position(conn, mode)
|
||||
conn.commit()
|
||||
closed = 0
|
||||
rows = conn.execute(
|
||||
rows = [dict(r) for r in conn.execute(
|
||||
"SELECT * FROM trade_order_monitors WHERE status='active'"
|
||||
).fetchall()
|
||||
for r in rows:
|
||||
mon = dict(r)
|
||||
).fetchall()]
|
||||
conn.commit()
|
||||
for mon in rows:
|
||||
mid = int(mon.get("id") or 0)
|
||||
sym = (mon.get("symbol") or "").strip()
|
||||
direction = (mon.get("direction") or "long").strip().lower()
|
||||
|
||||
Reference in New Issue
Block a user