Skip to content

Commit 49ad9c3

Browse files
authored
Connect to SQLite using WAL mode
Significantely speeds up all database requests and should solve the dreaded "database is currently locked" issue that shows up from time to time
1 parent 0bbd8a1 commit 49ad9c3

File tree

1 file changed

+1
-0
lines changed
  • psa_car_controller/psacc/repository

1 file changed

+1
-0
lines changed

psa_car_controller/psacc/repository/db.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class CustomSqliteConnection(sqlite3.Connection):
4040
def __init__(self, *args, **kwargs): # real signature unknown
4141
super().__init__(*args, **kwargs)
4242
self.callbacks = []
43+
self.execute("PRAGMA journal_mode=WAL;")
4344

4445
def execute_callbacks(self):
4546
for callback in self.callbacks:

0 commit comments

Comments
 (0)