mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
put atomic block inside lock block
This commit is contained in:
parent
c5aa9ee12b
commit
786e907e3b
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user