summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-06 10:16:11 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-21 12:52:55 +0000
commit3e27297da94b0e78e4eac38bc41a56e81496ea95 (patch)
tree6d86f60a463939e2a8a8552094907b6c242f5132
parentb6511ded0a03115c408531d8c7addea0c65886fd (diff)
downloadbuildstream-3e27297da94b0e78e4eac38bc41a56e81496ea95.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 83032fbd0..88f6863d6 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1774,6 +1774,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