Merge pull request #2960 from AlanCoding/bad_locks

Put atomic block inside lock block
This commit is contained in:
Alan Rominger
2018-08-30 14:53:01 -04:00
committed by GitHub

View File

@@ -679,9 +679,9 @@ class TaskManager():
return finished_wfjs
def schedule(self):
with transaction.atomic():
# Lock
with advisory_lock('task_manager_lock', wait=False) as acquired:
# Lock
with advisory_lock('task_manager_lock', wait=False) as acquired:
with transaction.atomic():
if acquired is False:
logger.debug("Not running scheduler, another task holds lock")
return