Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 5327732

Browse files
committed
Enable WAL for SQLite
Signed-off-by: Lorenzo Manacorda <[email protected]>
1 parent ac1a317 commit 5327732

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

changelog.d/13897.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Enable WAL for SQLite installs. Contributed by [asymmetric](https://github.com/asymmetric).

synapse/storage/engines/sqlite.py

+4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ def on_new_connection(self, db_conn: "LoggingDatabaseConnection") -> None:
8888

8989
db_conn.create_function("rank", 1, _rank)
9090
db_conn.execute("PRAGMA foreign_keys = ON;")
91+
92+
# Enable WAL.
93+
# see https://www.sqlite.org/wal.html
94+
db_conn.execute("PRAGMA journal_mode = WAL;")
9195
db_conn.commit()
9296

9397
def is_deadlock(self, error: Exception) -> bool:

0 commit comments

Comments
 (0)