diff --git a/src/paperless/settings/custom.py b/src/paperless/settings/custom.py index 274dbbc05..9e9468e21 100644 --- a/src/paperless/settings/custom.py +++ b/src/paperless/settings/custom.py @@ -235,7 +235,7 @@ def parse_db_settings(data_dir: Path) -> dict[str, dict[str, Any]]: "PRAGMA temp_store=MEMORY;" "PRAGMA mmap_size=134217728;" "PRAGMA journal_size_limit=67108864;" - "PRAGMA cache_size=-8000" + "PRAGMA cache_size=-8000" # negative = KiB; -8000 ≈ 8 MB ), # IMMEDIATE acquires the write lock at BEGIN, ensuring # busy_timeout is respected from the start of the transaction. @@ -285,6 +285,9 @@ def parse_db_settings(data_dir: Path) -> dict[str, dict[str, Any]]: "key": os.getenv("PAPERLESS_DBSSLKEY"), }, # READ COMMITTED eliminates gap locking and reduces deadlocks. + # Django also defaults to "read committed" for MySQL/MariaDB, but + # we set it explicitly so the intent is clear and survives any + # future changes to Django's default. # Requires binlog_format=ROW if binary logging is enabled. "isolation_level": "read committed", } diff --git a/src/paperless/tests/settings/test_custom_parsers.py b/src/paperless/tests/settings/test_custom_parsers.py index cf0321e80..0443c5e99 100644 --- a/src/paperless/tests/settings/test_custom_parsers.py +++ b/src/paperless/tests/settings/test_custom_parsers.py @@ -354,7 +354,7 @@ class TestParseDbSettings: }, }, }, - id="sqlite-init-command-override", + id="sqlite-options-override", ), pytest.param( {