mirror of
https://github.com/ansible/awx.git
synced 2026-02-28 08:18:43 -03:30
put atomic block inside lock block
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user