Log SQL statements in progress as warning

This commit is contained in:
shortcutme 2019-11-19 02:09:36 +01:00
parent 96e7fbdca1
commit 8f27f50b34
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 4 additions and 1 deletions

View File

@ -124,7 +124,10 @@ class Db(object):
self.log.debug("Commited in %.3fs (reason: %s)" % (time.time() - s, reason))
return True
except Exception as err:
self.log.error("Commit error: %s" % err)
if "SQL statements in progress" in str(err):
self.log.warning("Commit delayed: %s (reason: %s)" % (Debug.formatException(err), reason))
else:
self.log.error("Commit error: %s (reason: %s)" % (Debug.formatException(err), reason))
return False
def insertOrUpdate(self, *args, **kwargs):