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
......@@ -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):
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':
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment