mirror of
https://github.com/ansible/awx.git
synced 2026-03-06 19:21:06 -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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user