mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-06-10 03:02:09 +00:00
fix(vaults): enable WAL on SQLite vault to fix concurrent locks
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -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
|
||||||
|
|||||||
@@ -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"):
|
||||||
|
|||||||
Reference in New Issue
Block a user