From b0ae88812c64f1bf100918edb86d6665b08ed77f Mon Sep 17 00:00:00 2001 From: imSp4rky Date: Thu, 21 May 2026 23:00:39 +0000 Subject: [PATCH] fix(vaults): enable WAL on SQLite vault to fix concurrent locks --- .gitignore | 3 +++ unshackle/vaults/SQLite.py | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 8a8754c..e05f8a2 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,9 @@ update_check.json *.pem *.bin *.db +*.db-shm +*.db-wal +*.db-journal *.ttf *.otf device_cert diff --git a/unshackle/vaults/SQLite.py b/unshackle/vaults/SQLite.py index a3f6447..2536296 100644 --- a/unshackle/vaults/SQLite.py +++ b/unshackle/vaults/SQLite.py @@ -208,7 +208,11 @@ class ConnectionFactory: self._store = threading.local() 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: if not hasattr(self._store, "conn"):