Skip to content
Snippets Groups Projects
Commit a340a6d4 authored by Andreas Valder's avatar Andreas Valder
Browse files

fixing 'ReferenceError: weakly-referenced object no longer exists' in db abstraction layer

parent 0b8fe4f0
No related branches found
No related tags found
No related merge requests found
......@@ -86,10 +86,10 @@ elif config['DB_ENGINE'] == 'mysql':
def query(operation, *params, delim="sep", nlfix=True):
operation, params = fix_query(operation, params)
cur = get_dbcursor()
tries = 0
while (tries < 10):
try:
cur = get_dbcursor()
cur.execute(operation, params)
except mysql.connector.errors.InternalError as e:
if e.msg == 'Deadlock found when trying to get lock; try restarting transaction':
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment