diff --git a/conservancy/settings/prod.py b/conservancy/settings/prod.py index 35b9b52b..c633ddab 100644 --- a/conservancy/settings/prod.py +++ b/conservancy/settings/prod.py @@ -20,6 +20,13 @@ DATABASES = { 'default': { 'NAME': '/var/lib/www/database/conservancy-website.sqlite3', 'ENGINE': 'django.db.backends.sqlite3', + # WAL mode allows concurrent reading and writing. It is enabled permanently with: + # sudo -u www-data sqlite3 conservancy-website.sqlite3 'PRAGMA journal_mode=WAL;' + 'OPTIONS': { + # Reduce the incidence of "database locked" errors by allowing write + # requests to be queued for some seconds. + 'timeout': 5, + }, } }