summaryrefslogtreecommitdiff
path: root/src/buildstream/_scheduler
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2020-03-26 09:09:04 +0000
committerTristan van Berkom <tristan@codethink.co.uk>2020-11-04 16:23:00 +0900
commit1dc48793e42f54a8cdcba30b8dd21b52c5bac7f0 (patch)
treec64cad2d41e3a80bf8ca37a22b881165276dcdb2 /src/buildstream/_scheduler
parent5d51b8d00ff5de466521cdecb42dda1550e787d8 (diff)
downloadbuildstream-1dc48793e42f54a8cdcba30b8dd21b52c5bac7f0.tar.gz
_stream.py: Make `_enqueue_plan` a timed activitybschubert/notify-prepare-plan
This enqueue_plan can take a long time, as it triggers a verification of the 'cached' state for sources in some cases, which can take a long time.
Diffstat (limited to 'src/buildstream/_scheduler')
-rw-r--r--src/buildstream/_scheduler/queues/queue.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/buildstream/_scheduler/queues/queue.py b/src/buildstream/_scheduler/queues/queue.py
index f5aa2ca4c..e05d95188 100644
--- a/src/buildstream/_scheduler/queues/queue.py
+++ b/src/buildstream/_scheduler/queues/queue.py
@@ -174,13 +174,17 @@ class Queue:
#
# Args:
# elts (list): A list of Elements
+ # task (Task): The task to add progress to for the UI, if any
#
- def enqueue(self, elts):
+ def enqueue(self, elts, task=None):
if not elts:
return
# Obtain immediate element status
for elt in elts:
+ if task:
+ task.add_current_progress()
+
if self._required_element_check and not elt._is_required():
elt._set_required_callback(self._enqueue_element)
else: