Use sqlite3 write-ahead log
This commit is contained in:
parent
47b5788a09
commit
e44ce70a1c
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user