summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-03-06 10:16:11 +0000
committerTristan Van Berkom <tristan.vanberkom@codethink.co.uk>2019-03-24 21:24:24 +0900
commit7270c6817d65e6dfc2a07ad0f688aae75c814fe5 (patch)
tree04200604656abf3b5ca20e5b39a84e5943cd7810
parent1b8d04f33bb9b51bdd4655252fc26a569ae45006 (diff)
downloadbuildstream-7270c6817d65e6dfc2a07ad0f688aae75c814fe5.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 e121f6349..c5595e14a 100644
--- a/buildstream/_scheduler/queues/fetchqueue.py
+++ b/buildstream/_scheduler/queues/fetchqueue.py
@@ -69,7 +69,7 @@ class FetchQueue(Queue):
if not success:
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 9851d042e..7be27cb2a 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1602,6 +1602,15 @@ class Element(Plugin):
return artifact_size
+ # _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.