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-16 10:02:27 +0000
commit936a07c10bfb72c3e22b5421da1d8e508b1582f8 (patch)
treec41c1b42b224a37822d484ebd5afbd2984169c38
parent91b1c90a4409d70552625e6d67751cbf7cf0653b (diff)
downloadbuildstream-936a07c10bfb72c3e22b5421da1d8e508b1582f8.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.py8
2 files changed, 9 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..3f1ca02f9 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1769,6 +1769,14 @@ 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.
+ # The element can now compute its weak cache key.
+ #
+ def _fetch_done(self):
+ self._update_state()
+
# _pull_pending()
#
# Check whether the artifact will be pulled. If the pull operation is to