diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2020-12-07 08:04:36 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-12-07 08:04:36 +0000 |
commit | 5f68adb3f80b1d84edf900fde8cf40c84c297f91 (patch) | |
tree | f047c9f5d81c78534832f479eb51f7191f48cd55 /src/buildstream/_scheduler/queues/queue.py | |
parent | 458c05751f089673dc1cae8b8edfabfa32cf21b7 (diff) | |
parent | 3f07e6056076736ea63f5ed5b96f240978691da1 (diff) | |
download | buildstream-5f68adb3f80b1d84edf900fde8cf40c84c297f91.tar.gz |
Merge branch 'bschubert/optimize-job' into 'master'
First part of the parent-child job separation cleanup
See merge request BuildStream/buildstream!2111
Diffstat (limited to 'src/buildstream/_scheduler/queues/queue.py')
-rw-r--r-- | src/buildstream/_scheduler/queues/queue.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/buildstream/_scheduler/queues/queue.py b/src/buildstream/_scheduler/queues/queue.py index e05d95188..38595729c 100644 --- a/src/buildstream/_scheduler/queues/queue.py +++ b/src/buildstream/_scheduler/queues/queue.py @@ -269,19 +269,18 @@ class Queue: # # Args: # element (Element): The element which completed - # job (Job): The job which completed # - def _update_workspaces(self, element, job): - workspace_dict = None - if job.child_data: - workspace_dict = job.child_data.get("workspace", None) + def _update_workspaces(self, element): + # FIXME: Does this really needs to be done for every job or only some? + # If some, we should only run it for those. + workspace = element._get_workspace() # Handle any workspace modifications now # - if workspace_dict: + if workspace: context = element._get_context() workspaces = context.get_workspaces() - if workspaces.update_workspace(element._get_full_name(), workspace_dict): + if workspaces.update_workspace(element._get_full_name(), workspace.to_dict()): try: workspaces.save_config() except BstError as e: @@ -311,7 +310,7 @@ class Queue: # Update values that need to be synchronized in the main task # before calling any queue implementation - self._update_workspaces(element, job) + self._update_workspaces(element) # Give the result of the job to the Queue implementor, # and determine if it should be considered as processed |