~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/buildmaster/model/buildqueue.py

Merged builder-history-bug-890326 into builder-history-lfa.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
    )
59
59
from lp.services.job.interfaces.job import JobStatus
60
60
from lp.services.job.model.job import Job
61
 
from lp.services.propertycache import (
62
 
    cachedproperty,
63
 
    get_property_cache,
64
 
    )
65
61
 
66
62
 
67
63
def normalize_virtualization(virtualized):
142
138
        """See `IBuildQueue`."""
143
139
        return IBuildFarmJobBehavior(self.specific_job)
144
140
 
145
 
    @cachedproperty
 
141
    @property
146
142
    def specific_job(self):
147
143
        """See `IBuildQueue`."""
148
144
        specific_class = specific_job_classes()[self.job_type]
151
147
    @staticmethod
152
148
    def preloadSpecificJobData(queues):
153
149
        key = attrgetter('job_type')
154
 
        specific_jobs_dict = {}
155
150
        for job_type, grouped_queues in groupby(queues, key=key):
156
151
            specific_class = specific_job_classes()[job_type]
157
152
            queue_subset = list(grouped_queues)
163
158
            if len(list(specific_jobs)) == 0:
164
159
                continue
165
160
            specific_class.preloadJobsData(specific_jobs)
166
 
            specific_jobs_dict = dict(
167
 
                (specific_job.job, specific_job)
168
 
                    for specific_job in specific_jobs)
169
 
            for queue in queue_subset:
170
 
                cache = get_property_cache(queue)
171
 
                cache.specific_job = specific_jobs_dict[queue.job]
172
161
 
173
162
    @property
174
163
    def date_started(self):