summaryrefslogtreecommitdiff
path: root/src/buildstream/_scheduler/queues/pullqueue.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/_scheduler/queues/pullqueue.py')
-rw-r--r--src/buildstream/_scheduler/queues/pullqueue.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/buildstream/_scheduler/queues/pullqueue.py b/src/buildstream/_scheduler/queues/pullqueue.py
index 245293342..dfb00aa21 100644
--- a/src/buildstream/_scheduler/queues/pullqueue.py
+++ b/src/buildstream/_scheduler/queues/pullqueue.py
@@ -33,10 +33,8 @@ class PullQueue(Queue):
complete_name = "Pulled"
resources = [ResourceType.DOWNLOAD, ResourceType.CACHE]
- def process(self, element):
- # returns whether an artifact was downloaded or not
- if not element._pull():
- raise SkipJob(self.action_name)
+ def get_process_func(self):
+ return PullQueue._raise_skip_if_not_pulled
def status(self, element):
if not element._can_query_cache():
@@ -65,3 +63,8 @@ class PullQueue(Queue):
# immediately ready to query the artifact cache so that it
# may be pulled.
element._set_can_query_cache_callback(self._enqueue_element)
+
+ @staticmethod
+ def _raise_skip_if_not_pulled(element):
+ if not element._pull():
+ raise SkipJob(PullQueue.action_name)