fix(vaults): enable WAL on SQLite vault to fix concurrent locks

This commit is contained in:
imSp4rky
2026-05-21 23:00:39 +00:00
parent 746b573711
commit b0ae88812c
2 changed files with 8 additions and 1 deletions

3
.gitignore vendored
View File

@@ -13,6 +13,9 @@ update_check.json
*.pem *.pem
*.bin *.bin
*.db *.db
*.db-shm
*.db-wal
*.db-journal
*.ttf *.ttf
*.otf *.otf
device_cert device_cert

View File

@@ -208,7 +208,11 @@ class ConnectionFactory:
self._store = threading.local() self._store = threading.local()
def _create_connection(self) -> Connection: def _create_connection(self) -> Connection:
return sqlite3.connect(self._path) conn = sqlite3.connect(self._path, timeout=30.0)
conn.execute("PRAGMA journal_mode=WAL")
conn.execute("PRAGMA synchronous=NORMAL")
conn.execute("PRAGMA busy_timeout=30000")
return conn
def get(self) -> Connection: def get(self) -> Connection:
if not hasattr(self._store, "conn"): if not hasattr(self._store, "conn"):