plinth: Increase sqlite busy timeout from default 5s to 30s

Reduces the probability that plinth gives an error 500 because
the database is locked.

Test performed:
1) Lock the database:
> sqlite3 data/var/lib/plinth/plinth.sqlite3
sqlite> PRAGMA locking_mode = EXCLUSIVE;
sqlite> BEGIN EXCLUSIVE;
2) Visit plinth/apps/
3) Only after 30s plinth logs an exception:
django.db.utils.OperationalError: database is locked

Closes #1786
Related to #1443

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
[sunil: Move the timeout value to settings module as it is static]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa 2020-03-03 10:02:59 +02:00 committed by Sunil Mohan Adapa
parent ef4bd69c2a
commit 04b9538deb
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -67,6 +67,9 @@ CAPTCHA_FLITE_PATH = '/usr/bin/flite'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'OPTIONS': {
'timeout': 30
},
# Overridden based on the configuration key store_file
'NAME': '/var/lib/plinth/plinth.sqlite3'
}