From a340a6d48a4d579f42f8bd4b679adf179c7bc406 Mon Sep 17 00:00:00 2001 From: Andreas <andreasv@fsmpi.rwth-aachen.de> Date: Mon, 29 Jan 2018 13:02:46 +0100 Subject: [PATCH] fixing 'ReferenceError: weakly-referenced object no longer exists' in db abstraction layer --- db.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db.py b/db.py index 356da83..74db0a1 100644 --- a/db.py +++ b/db.py @@ -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': -- GitLab