~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/soyuz/browser/builder.py

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

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
from lp.buildmaster.model.buildqueue import BuildQueue
61
61
from lp.services.propertycache import (
62
62
    cachedproperty,
63
 
    get_property_cache,
64
63
    )
65
64
from lp.soyuz.browser.build import (
66
65
    BuildNavigationMixin,
153
152
    def builders(self):
154
153
        """All active builders"""
155
154
        def do_eager_load(builders):
156
 
            # Populate builders' currentjob cachedproperty.
 
155
            # Prefetch the jobs' data.
157
156
            queues = IStore(BuildQueue).find(
158
157
                BuildQueue,
159
158
                BuildQueue.builderID.is_in(
160
159
                    builder.id for builder in builders))
161
 
            queue_builders = dict(
162
 
                (queue.builderID, queue) for queue in queues)
163
 
            for builder in builders:
164
 
                cache = get_property_cache(builder)
165
 
                cache.currentjob = queue_builders.get(builder.id, None)
166
 
            # Prefetch the jobs' data.
167
160
            BuildQueue.preloadSpecificJobData(queues)
168
161
 
169
162
        return list(DecoratedResultSet(