From 4c638f0b21f12a0be357293fc25d8bbd1ecb5fb3 Mon Sep 17 00:00:00 2001 From: Nick Mills-Barrett Date: Fri, 1 Sep 2023 18:53:48 +0100 Subject: [PATCH] Add safety check before applying default synchronous Co-authored-by: Tulir Asokan --- mautrix/util/async_db/aiosqlite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mautrix/util/async_db/aiosqlite.py b/mautrix/util/async_db/aiosqlite.py index 18594c9c..80fa3cf8 100644 --- a/mautrix/util/async_db/aiosqlite.py +++ b/mautrix/util/async_db/aiosqlite.py @@ -134,7 +134,7 @@ def _add_missing_pragmas(init_commands: list[str]) -> list[str]: init_commands.append("PRAGMA foreign_keys = ON") if not has_journal_mode: init_commands.append("PRAGMA journal_mode = WAL") - if not has_synchronous: + if not has_synchronous and "PRAGMA journal_mode = WAL" in init_commands: init_commands.append("PRAGMA synchronous = NORMAL") if not has_busy_timeout: init_commands.append("PRAGMA busy_timeout = 5000")