You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ro...@apache.org on 2020/12/29 13:50:03 UTC
[buildstream] 02/05: Add workaround for buildqueue job_complete
direct callback
This is an automated email from the ASF dual-hosted git repository.
root pushed a commit to branch tpollard/notificationhandlertmp
in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit 8f844bc3dc2ccb32d308a29e78305e76c70e6818
Author: Tom Pollard <to...@codethink.co.uk>
AuthorDate: Tue Jun 18 12:34:22 2019 +0100
Add workaround for buildqueue job_complete direct callback
---
src/buildstream/_scheduler/scheduler.py | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py
index 0ed5ada..c659452 100644
--- a/src/buildstream/_scheduler/scheduler.py
+++ b/src/buildstream/_scheduler/scheduler.py
@@ -279,11 +279,14 @@ class Scheduler():
# queue (Queue): The Queue holding a complete job
# job (Job): The completed Job
# status (JobStatus): The status of the completed job
+ # process_jobs (bool): If the scheduler should also process the
+ # job, else just generate the notification
#
- def job_completed(self, job, status):
+ def job_completed(self, job, status, process_jobs=True):
- # Remove from the active jobs list
- self._active_jobs.remove(job)
+ if process_jobs:
+ # Remove from the active jobs list
+ self._active_jobs.remove(job)
if status == JobStatus.FAIL:
# If it's an elementjob, we want to compare against the failure messages
@@ -297,8 +300,9 @@ class Scheduler():
element=element)
self.message(message)
- # Now check for more jobs
- self._sched()
+ if process_jobs:
+ # Now check for more jobs
+ self._sched()
# check_cache_size():
#