bitbake: 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

(Bitbake rev: 7f3a4e0330f4de3ba8e092bc1c15a53d8c2be073)

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>
This commit is contained in:
Michael Wood 2015-08-06 19:01:36 +03:00 committed by Richard Purdie
parent af72d0fbb2
commit b12e51c352
1 changed files with 6 additions and 0 deletions

View File

@ -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: