Clarify isolation_level intent and cache_size unit

This commit is contained in:
Trenton H
2026-04-14 16:22:45 -07:00
parent 1c63d9597d
commit f09d896f8e
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -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",
}
@@ -354,7 +354,7 @@ class TestParseDbSettings:
},
},
},
id="sqlite-init-command-override",
id="sqlite-options-override",
),
pytest.param(
{