From: Michael Tremer Date: Wed, 1 Nov 2017 14:35:48 +0000 (+0000) Subject: builders: Avoid any caching when checking build queue X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=adf36d4f5b29ac79e6491d47116339b2c04afb60;p=pbs.git builders: Avoid any caching when checking build queue Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/builders.py b/src/buildservice/builders.py index dc5a50a0..59c6c722 100644 --- a/src/buildservice/builders.py +++ b/src/buildservice/builders.py @@ -426,7 +426,10 @@ class Builder(base.DataObject): logging.debug("%s has too many jobs running" % self) return - for job in self.jobqueue: + # Get all jobs from the job queue this builder can build + jobs = self.backend.jobqueue.for_arches(self.supported_arches) + + for job in jobs: logging.debug("Looking at %s..." % job) # Only allow building test jobs in test mode @@ -438,8 +441,12 @@ class Builder(base.DataObject): logging.debug("We are not the designated builder for this job (%s is)" % job.designated_builder) continue + logging.debug("Bingo!") + return job + logging.debug("No eligible jobs in the job queue") + def get_history(self, *args, **kwargs): kwargs["builder"] = self