Extend cache timeout to schedule runner also, block running a schedule

of an inventory update or a project update if its schedule places
it within that time also
This commit is contained in:
Matthew Jones
2014-11-13 13:47:23 -05:00
parent 04ec19023f
commit 300396c7ce
4 changed files with 23 additions and 0 deletions

View File

@@ -298,6 +298,14 @@ class Project(UnifiedJobTemplate, ProjectOptions):
def create_project_update(self, **kwargs):
return self.create_unified_job(**kwargs)
@property
def cache_timeout_blocked(self):
if not self.last_job_run:
return False
if (self.last_job_run + datetime.timedelta(seconds=self.update_cache_timeout)) > now():
return True
return False
@property
def needs_update_on_launch(self):
if self.active and self.scm_type and self.scm_update_on_launch: