fix: backfill sleep 2s per batch to avoid SQLite WAL lock contention

This commit is contained in:
root 2026-02-27 15:44:43 +00:00
parent 35fcb7cef0
commit 23c7597a40

View File

@ -37,7 +37,7 @@ DB_PATH = os.path.join(os.path.dirname(__file__), "..", "arb.db")
BINANCE_FAPI = "https://fapi.binance.com/fapi/v1" BINANCE_FAPI = "https://fapi.binance.com/fapi/v1"
HEADERS = {"User-Agent": "Mozilla/5.0 ArbitrageEngine/backfill"} HEADERS = {"User-Agent": "Mozilla/5.0 ArbitrageEngine/backfill"}
BATCH_SIZE = 1000 BATCH_SIZE = 1000
SLEEP_MS = 200 # 毫秒/请求 SLEEP_MS = 2000 # 低优先级2秒/请求,让出锁给实时服务
# ─── DB helpers ────────────────────────────────────────────────── # ─── DB helpers ──────────────────────────────────────────────────