persist_data: handle locked db for SELECT
Parallel processes interacting with the persist_data db can quite easily explode without this. (Bitbake rev: b3d5432cff0ff28f4c8a5bcf10efa3e383b4fd4d) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
parent
f565258368
commit
3a2176fe73
|
@ -127,9 +127,7 @@ class PersistData:
|
||||||
count = 0
|
count = 0
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
ret = self.cursor.execute(*query)
|
return self.cursor.execute(*query)
|
||||||
#print "Had to retry %s times" % count
|
|
||||||
return ret
|
|
||||||
except sqlite3.OperationalError as e:
|
except sqlite3.OperationalError as e:
|
||||||
if 'database is locked' in str(e) and count < 500:
|
if 'database is locked' in str(e) and count < 500:
|
||||||
count = count + 1
|
count = count + 1
|
||||||
|
|
Loading…
Reference in New Issue