mirror of
https://github.com/ansible/awx.git
synced 2026-01-12 10:30:03 -03:30
Check project and inventory source update cache timeout when deciding
whether or not to spawn an instance of either one as a dependency
This commit is contained in:
parent
1dc3aa8ab1
commit
74602f1009
@ -312,11 +312,13 @@ class Job(UnifiedJob, JobOptions):
|
||||
if obj.inventory_source in inventory_sources:
|
||||
inventory_sources_found.append(obj.inventory_source)
|
||||
if not project_found and self.project.scm_update_on_launch:
|
||||
dependencies.append(self.project.create_project_update(launch_type='dependency'))
|
||||
if not self.project.last_job_run + datetime.timedelta(seconds=self.project.scm_update_cache_timeout) > now():
|
||||
dependencies.append(self.project.create_project_update(launch_type='dependency'))
|
||||
if inventory_sources.count(): # and not has_setup_failures? Probably handled as an error scenario in the task runner
|
||||
for source in inventory_sources:
|
||||
if not source in inventory_sources_found:
|
||||
dependencies.append(source.create_inventory_update(launch_type='dependency'))
|
||||
if not source.last_job_run + datetime.timedelta(seconds=source.update_cache_timeout) > now():
|
||||
dependencies.append(source.create_inventory_update(launch_type='dependency'))
|
||||
return dependencies
|
||||
|
||||
def signal_start(self, **kwargs):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user