fix: 全部写库scanner统一加busy_timeout=30000——整点撞锁SQLite自动等待,根治崩溃

This commit is contained in:
xxm
2026-08-18 10:00:19 +08:00
parent e18cf7e76e
commit 0070141bce
6 changed files with 23 additions and 0 deletions
@@ -70,6 +70,7 @@ def get_stock_pool():
"""获取待扫描股票池"""
import sqlite3
conn = sqlite3.connect(str(DB_PATH))
conn.execute("PRAGMA busy_timeout=30000") # 2026-08-18 整点撞锁等待
# 从holding_strategies拿已有策略股
existing = set()
@@ -210,6 +211,7 @@ def main():
# 写入DB
conn = sqlite3.connect(str(DB_PATH))
conn.execute("PRAGMA busy_timeout=30000") # 2026-08-18 整点撞锁等待
inserted = 0
for score, code, info, detail in candidates[:10]: # 最多10只
name = info["name"]