~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-02 15:48:28 UTC
  • mfrom: (14513.2.4 builders-timeout-903827)
  • Revision ID: launchpad@pqm.canonical.com-20120102154828-r4echs7u11g99u8b
[r=adeuring][bug=903827] Cache objects prior to displaying builders'
        homepage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
100
100
        """See `IBuildFarmJobOld`."""
101
101
        raise NotImplementedError
102
102
 
 
103
    def getByJobs(self, job):
 
104
        """See `IBuildFarmJobOld`."""
 
105
        raise NotImplementedError
 
106
 
103
107
    def jobStarted(self):
104
108
        """See `IBuildFarmJobOld`."""
105
109
        pass
160
164
        """
161
165
        raise NotImplementedError
162
166
 
 
167
    @staticmethod
 
168
    def preloadBuildFarmJobs(jobs):
 
169
        """Preload the build farm jobs to which the given jobs will delegate.
 
170
 
 
171
        """
 
172
        pass
 
173
 
163
174
    @classmethod
164
175
    def getByJob(cls, job):
165
176
        """See `IBuildFarmJobOld`."""
166
177
        store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
167
178
        return store.find(cls, cls.job == job).one()
168
179
 
 
180
    @classmethod
 
181
    def getByJobs(cls, jobs):
 
182
        """See `IBuildFarmJobOld`.
 
183
        """
 
184
        store = getUtility(IStoreSelector).get(MAIN_STORE, DEFAULT_FLAVOR)
 
185
        job_ids = [job.id for job in jobs]
 
186
        return store.find(
 
187
            cls, cls.job_id.is_in(job_ids))
 
188
 
169
189
    def generateSlaveBuildCookie(self):
170
190
        """See `IBuildFarmJobOld`."""
171
191
        buildqueue = getUtility(IBuildQueueSet).getByJob(self.job)