diff options
author | Michael Wood <michael.g.wood@intel.com> | 2015-08-06 19:01:36 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-08-06 16:04:10 -0500 |
commit | 7f3a4e0330f4de3ba8e092bc1c15a53d8c2be073 (patch) | |
tree | 2ba1d6be0b120ca47c2c0151cb5ebf6c640478a0 /lib/toaster/toastermain/settings.py | |
parent | b5100bfd4cb32a9b59b0554c6dbc3a4295da7d8e (diff) | |
download | bitbake-contrib-7f3a4e0330f4de3ba8e092bc1c15a53d8c2be073.tar.gz |
toastermain: Add a longer default database timeout
When using sqlite we sometimes see Database Locked exceptions when we
fire off database calls asynchronously from the UI. We need sqlite to
wait a bit longer for the lock to be released.
n.b In production setup we hopefully wouldn't be using sqlite.
docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors
Signed-off-by: Michael Wood <michael.g.wood@intel.com>
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/toastermain/settings.py')
-rw-r--r-- | lib/toaster/toastermain/settings.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/toaster/toastermain/settings.py b/lib/toaster/toastermain/settings.py index c72a90411..b149a5ed8 100644 --- a/lib/toaster/toastermain/settings.py +++ b/lib/toaster/toastermain/settings.py @@ -49,6 +49,12 @@ DATABASES = { } } +# Needed when Using sqlite especially to add a longer timeout for waiting +# for the database lock to be released +# https://docs.djangoproject.com/en/1.6/ref/databases/#database-is-locked-errors +if 'sqlite' in DATABASES['default']['ENGINE']: + DATABASES['default']['OPTIONS'] = { 'timeout': 20 } + # Reinterpret database settings if we have DATABASE_URL environment variable defined if 'DATABASE_URL' in os.environ: |