]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
prserv: Allow 'table is locked' matching for retry loop
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Aug 2013 16:52:20 +0000 (17:52 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Aug 2013 16:52:24 +0000 (17:52 +0100)
Try and avoid errors like "ERROR: database table is locked: PRMAIN_nohist"
by retrying if we see the string "is locked".

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/prserv/db.py

index 7d74327c5563f3659c4cf85d29e888730ff6c526..7bc1980099e8690f80403f6be54782d9929d5839 100644 (file)
@@ -37,7 +37,7 @@ class PRTable(object):
             try:
                 return self.conn.execute(*query)
             except sqlite3.OperationalError as exc:
-                if 'database is locked' in str(exc) and count < 500:
+                if 'is locked' in str(exc) and count < 500:
                     count = count + 1
                     continue
                 raise exc