if self.has_finished():
return
+ # On success, update all repositories
+ if not job.has_failed():
+ await self._update_repos()
+
# If all jobs have finished, the build has finished
elif all((j.has_finished() for j in self.jobs)):
return await self.finished(success=True)
return list(repos)
+ async def _update_repos(self):
+ """
+ This method should be called if the repositories should be updated
+ """
+ await asyncio.gather(
+ *(repo.has_changed() for repo in self.repos),
+ )
+
## Bugs
def get_bug_ids(self):
# Propagate any changes to the build
await self.build._job_finished(job=self)
- # On success, update all repositories
- if success:
- await asyncio.gather(
- *(repo.has_changed() for repo in self.build.repos),
- )
-
def is_running(self):
"""
Returns True if this job is running