Use sqlite3 write-ahead log

This commit is contained in:
Astrid 2021-01-06 12:03:52 +01:00
parent 47b5788a09
commit e44ce70a1c

View File

@ -9,6 +9,10 @@ def create_connection():
conn = None conn = None
try: try:
conn = sql.connect(os.path.join(data_dir, "matteo.db")) conn = sql.connect(os.path.join(data_dir, "matteo.db"))
# enable write-ahead log for performance and resilience
conn.execute('pragma journal_mode=wal')
return conn return conn
except: except:
print("oops, db connection no work") print("oops, db connection no work")