for job in self.jobqueue:
logging.debug("Looking at %s..." % job)
+
# Only allow building test jobs in test mode
if self.testmode and not job.test:
continue
- # If we are the fastest builder to handle this job, we will
- # get it.
- if job.candidate_builders:
- fastest_builder = job.candidate_builders.pop(0)
-
- if not self == fastest_builder:
- logging.debug("We are not the fastest builder for this job (%s is)" % fastest_builder)
- continue
+ # We will skip this job if we are not the designated builder
+ if job.designated_builder and not job.designated_builder == self:
+ logging.debug("We are not the designated builder for this job (%s is)" % job.designated_builder)
+ continue
return job
builder = lazy_property(get_builder, set_builder)
- @lazy_property
+ @property
def candidate_builders(self):
"""
Returns all active builders that could build this job
# Sort them by the fastest builder first
return sorted(builders, key=lambda b: -b.performance_index)
+ @property
+ def designated_builder(self):
+ """
+ Returns the fastest candidate builder builder
+ """
+ if self.candidate_builders:
+ return self.candidate_builders[0]
+
@property
def arch(self):
return self.data.arch