mirror of
https://github.com/ansible/awx.git
synced 2026-03-18 09:27:31 -02:30
Check exit conditions in loop waiting for project flock
This commit is contained in:
@@ -402,6 +402,10 @@ class BaseTask(object):
|
|||||||
raise
|
raise
|
||||||
else:
|
else:
|
||||||
time.sleep(1.0)
|
time.sleep(1.0)
|
||||||
|
self.instance.refresh_from_db(fields=['cancel_flag'])
|
||||||
|
if self.instance.cancel_flag or signal_callback():
|
||||||
|
logger.debug(f"Unified job {self.instance.id} was canceled while waiting for project file lock")
|
||||||
|
return
|
||||||
waiting_time = time.time() - start_time
|
waiting_time = time.time() - start_time
|
||||||
|
|
||||||
if waiting_time > 1.0:
|
if waiting_time > 1.0:
|
||||||
@@ -1294,10 +1298,6 @@ class RunProjectUpdate(BaseTask):
|
|||||||
# re-create root project folder if a natural disaster has destroyed it
|
# re-create root project folder if a natural disaster has destroyed it
|
||||||
project_path = instance.project.get_project_path(check_if_exists=False)
|
project_path = instance.project.get_project_path(check_if_exists=False)
|
||||||
|
|
||||||
instance.refresh_from_db(fields=['cancel_flag'])
|
|
||||||
if instance.cancel_flag:
|
|
||||||
logger.debug("ProjectUpdate({0}) was canceled".format(instance.pk))
|
|
||||||
return
|
|
||||||
if instance.launch_type != 'sync':
|
if instance.launch_type != 'sync':
|
||||||
self.acquire_lock(instance.project, instance.id)
|
self.acquire_lock(instance.project, instance.id)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user