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

Commit

Permalink
Enable WAL for SQLite
Browse files Browse the repository at this point in the history
Signed-off-by: Lorenzo Manacorda <[email protected]>
  • Loading branch information
asymmetric committed Sep 24, 2022
1 parent ac1a317 commit 9474d50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions synapse/storage/engines/sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ def on_new_connection(self, db_conn: "LoggingDatabaseConnection") -> None:

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:
Expand Down

0 comments on commit 9474d50

Please sign in to comment.