return list(jobs)
- async def launch(self, *jobs):
+ async def launch(self, jobs):
"""
Called to launch all given jobs
"""
)
# Propagate any changes to the build
- await self.build._job_finished(job=self)
+ return await self.build._job_finished(job=self)
def is_pending(self):
if self.has_finished():
raise RuntimeError("Job %s cannot be retried" % self)
# Clone the job
- job = self.clone()
-
- # Launch the newly created job
- self.backend.run_task(self.backend.jobs.launch, job)
+ return self.clone()
# Log
})
# Launch all jobs (in the background)
- self.backend.run_task(self.backend.jobs.launch, *build.jobs)
+ self.backend.run_task(self.backend.builds.launch, [build])
class IndexHandler(base.BaseHandler):
# Mark the job as finished
with self.db.transaction():
- await self.job.finished(success=success, logfile=logfile, packages=packages)
+ builds = await self.job.finished(success=success,
+ logfile=logfile, packages=packages)
# Try to dispatch the next job
self.backend.run_task(self.backend.jobs.queue.dispatch)
+ # Launch any (test) builds
+ if builds:
+ self.backend.run_task(self.backend.builds.launch, builds)
+
class APIv1LogStreamHandler(base.BackendMixin, tornado.websocket.WebSocketHandler):
# No authentication required
raise tornado.web.HTTPError(404, "Could not find job %s" % uuid)
with self.db.transaction():
- await job.retry(self.current_user)
+ job = await job.retry(self.current_user)
+
+ # Launch the newly created job
+ self.backend.run_task(self.backend.jobs.launch, [job])
# Redirect back to the build page
self.redirect("/builds/%s" % job.build.uuid)