mirror of
https://github.com/ZwareBear/awx.git
synced 2026-04-30 11:51:48 -05:00
Add a default maximum of 10 jobs waiting from a job template if launched
by a schedule
This commit is contained in:
@@ -286,6 +286,10 @@ class JobTemplate(UnifiedJobTemplate, JobOptions):
|
||||
|
||||
@property
|
||||
def cache_timeout_blocked(self):
|
||||
if Job.objects.filter(job_template=self, status__in=['pending', 'waiting', 'running']).count() > getattr(settings, 'SCHEDULE_MAX_JOBS', 10):
|
||||
logger.error("Job template %s could not be started because there are more than %s other jobs from that template waiting to run" %
|
||||
(self.name, getattr(settings, 'SCHEDULE_MAX_JOBS', 10)))
|
||||
return True
|
||||
return False
|
||||
|
||||
def _can_update(self):
|
||||
|
||||
Reference in New Issue
Block a user