summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorasymmetric <lorenzo@mailbox.org>2022-10-25 11:22:55 +0200
committerGitHub <noreply@github.com>2022-10-25 10:22:55 +0100
commit8c94dd3a277d4e11192f98a9ca32cb6638606b66 (patch)
tree399b6a5590c7c4177af89625fe1589ec62a344f3 /synapse/storage
parentReturn NOT_JSON if decode fails and defer set_timeline_upper_limit ca… (#14... (diff)
downloadsynapse-8c94dd3a277d4e11192f98a9ca32cb6638606b66.tar.xz
Enable WAL for SQLite (#13897)
Signed-off-by: Lorenzo Manacorda <lorenzo@mailbox.org>
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/engines/sqlite.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py
index faa574dbfd..14260442b6 100644
--- a/synapse/storage/engines/sqlite.py
+++ b/synapse/storage/engines/sqlite.py
@@ -88,6 +88,10 @@ class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection, sqlite3.Cursor]):
 
         db_conn.create_function("rank", 1, _rank)
         db_conn.execute("PRAGMA foreign_keys = ON;")
+
+        # Enable WAL.
+        # see https://www.sqlite.org/wal.html
+        db_conn.execute("PRAGMA journal_mode = WAL;")
         db_conn.commit()
 
     def is_deadlock(self, error: Exception) -> bool: