mirror of
https://github.com/inventree/InvenTree.git
synced 2026-04-05 02:50:58 +00:00
Make WAL mode configurable for sqlite (#11585)
This commit is contained in:
@@ -297,6 +297,7 @@ If running with a SQLite database backend, the following additional options are
|
|||||||
| Environment Variable | Configuration File | Description | Default |
|
| Environment Variable | Configuration File | Description | Default |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
| INVENTREE_DB_TIMEOUT | database.timeout | Database connection timeout (s) | 10 |
|
| INVENTREE_DB_TIMEOUT | database.timeout | Database connection timeout (s) | 10 |
|
||||||
|
| INVENTREE_DB_WAL_MODE | database.wal_mode | Enable Write-Ahead Logging (WAL) mode for SQLite databases | True |
|
||||||
|
|
||||||
## Caching
|
## Caching
|
||||||
|
|
||||||
|
|||||||
@@ -148,5 +148,6 @@ def set_sqlite_options(db_options: dict):
|
|||||||
# not possible to implement any lower isolation levels in SQLite.
|
# not possible to implement any lower isolation levels in SQLite.
|
||||||
# https://www.sqlite.org/isolation.html
|
# https://www.sqlite.org/isolation.html
|
||||||
|
|
||||||
# Specify that we want to use Write-Ahead Logging (WAL) mode for SQLite databases, as this allows for better concurrency and performance
|
if get_boolean_setting('INVENTREE_DB_WAL_MODE', 'database.wal_mode', True):
|
||||||
db_options['init_command'] = 'PRAGMA journal_mode=WAL;'
|
# Specify that we want to use Write-Ahead Logging (WAL) mode for SQLite databases, as this allows for better concurrency and performance
|
||||||
|
db_options['init_command'] = 'PRAGMA journal_mode=WAL;'
|
||||||
|
|||||||
Reference in New Issue
Block a user