From: Michael Tremer Date: Tue, 31 Oct 2017 18:29:10 +0000 (+0000) Subject: jobs: Builders with too many jobs are not candidates for building X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05aa7b2e5385e68f0b73068790fd4f3a8393e2f1;p=pbs.git jobs: Builders with too many jobs are not candidates for building Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/jobs.py b/src/buildservice/jobs.py index 34891227..1efc4cc3 100644 --- a/src/buildservice/jobs.py +++ b/src/buildservice/jobs.py @@ -359,6 +359,9 @@ class Job(base.DataObject): # Remove all builders that are not available builders = (b for b in builders if b.enabled and b.is_online()) + # Remove all builders that have too many jobs + builders = (b for b in builders if not b.too_many_jobs) + # Sort them by the fastest builder first return sorted(builders, key=lambda b: -b.performance_index)