summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-06 10:16:11 +0000
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-17 18:42:37 +0000
commit0c9c658f9cec49c2b60fbad62aec6aa6aa9a7988 (patch)
treebb3972adc984972c1f099675f42394387678dfa1
parent91b1c90a4409d70552625e6d67751cbf7cf0653b (diff)
downloadbuildstream-0c9c658f9cec49c2b60fbad62aec6aa6aa9a7988.tar.gz
element.py: Add _fetch_done method and use this to update the state
This is to be consistent will all other queues that follow this setup.
-rw-r--r--buildstream/_scheduler/queues/fetchqueue.py2
-rw-r--r--buildstream/element.py9
2 files changed, 10 insertions, 1 deletions
diff --git a/buildstream/_scheduler/queues/fetchqueue.py b/buildstream/_scheduler/queues/fetchqueue.py
index 5295d4d21..546c65b65 100644
--- a/buildstream/_scheduler/queues/fetchqueue.py
+++ b/buildstream/_scheduler/queues/fetchqueue.py
@@ -71,7 +71,7 @@ class FetchQueue(Queue):
if status == JobStatus.FAIL:
return
- element._update_state()
+ element._fetch_done()
# Successful fetch, we must be CACHED now
assert element._get_consistency() == Consistency.CACHED
diff --git a/buildstream/element.py b/buildstream/element.py
index 250e4ae87..58419d953 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1769,6 +1769,15 @@ class Element(Plugin):
def _get_build_log(self):
return self._build_log_path
+ # _fetch_done()
+ #
+ # Indicates that fetching the sources for this element has been done.
+ #
+ def _fetch_done(self):
+ # We are not updating the state recursively here since fetching can
+ # never end up in updating them.
+ self._update_state()
+
# _pull_pending()
#
# Check whether the artifact will be pulled. If the pull operation is to