fix(sqlite): 调整busy_timeout设置为10秒以减少锁定错误

This commit is contained in:
Windpicker-owo
2025-12-08 18:11:23 +08:00
parent 7c2843de64
commit b5e7f6313f

View File

@@ -208,7 +208,7 @@ async def _enable_sqlite_optimizations(engine: AsyncEngine):
# 启用外键约束
await conn.execute(text("PRAGMA foreign_keys = ON"))
# 设置busy_timeout避免锁定错误
await conn.execute(text("PRAGMA busy_timeout = 60000"))
await conn.execute(text("PRAGMA busy_timeout = 10000"))
# 设置缓存大小10MB
await conn.execute(text("PRAGMA cache_size = -10000"))
# 临时存储使用内存