return list(jobs)
- async def depcheck(self, jobs):
+ async def launch(self, *jobs):
"""
- Performs a dependency check on all given jobs concurrently
+ Called to launch all given jobs
"""
- if jobs:
- results = await asyncio.gather(*(job.depcheck() for job in jobs))
+ if not jobs:
+ return
- # Try to dispatch any jobs afterwards
- if any(results):
- await self.backend.jobs.queue.dispatch()
+ # Perform dependency checks for all jobs
+ results = await asyncio.gather(*(job.depcheck() for job in jobs))
+ # Try to dispatch any jobs afterwards
+ if any(results):
+ await self.backend.jobs.queue.dispatch()
class Queue(base.Object):
# Clone the job
job = self.clone()
- # Schedule a dependency check
- self.backend.run_task(self.depcheck)
+ # Launch the newly created job
+ self.backend.run_task(self.backend.jobs.launch, job)
# Log
"name" : "%s" % build,
})
- # Run dependency check on all jobs (in the background)
- self.backend.run_task(self.backend.jobs.depcheck, build.jobs)
+ # Launch all jobs (in the background)
+ self.backend.run_task(self.backend.jobs.launch, build.jobs)
class IndexHandler(base.BaseHandler):