summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-10 16:23:35 +0900
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2017-07-10 16:24:58 +0900
commit09fd7e0c44303da4e965f9ab743237fa1c22296f (patch)
tree33c303ed43c6745fce311a4d4bdc3f948354e8c9
parenta5cacbe614b2cd8bd4b032d391850c41388029eb (diff)
downloadbuildstream-09fd7e0c44303da4e965f9ab743237fa1c22296f.tar.gz
_scheduler/pullqueue.py: If an artifact was not downloaded, mark the element as skipped.
-rw-r--r--buildstream/_scheduler/pullqueue.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/buildstream/_scheduler/pullqueue.py b/buildstream/_scheduler/pullqueue.py
index 2c7e5288e..c5113bd0c 100644
--- a/buildstream/_scheduler/pullqueue.py
+++ b/buildstream/_scheduler/pullqueue.py
@@ -32,8 +32,8 @@ class PullQueue(Queue):
queue_type = QueueType.FETCH
def process(self, element):
- # does not raise an exception if artifact is unavailable
- element._pull()
+ # returns whether an artifact was downloaded or not
+ return element._pull()
def skip(self, element):
return element._cached()
@@ -41,7 +41,11 @@ class PullQueue(Queue):
def done(self, element, result, returncode):
if returncode != 0:
- return
+ return False
# return code is 0 even if artifact was unavailable
element._cached(recalculate=True)
+
+ # Element._pull() returns True if it downloaded an artifact,
+ # here we want to appear skipped if we did not download.
+ return not result