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-07 17:08:11 +0000
commite97ba84077322afa8a29f3cbfc54c5e6c82873e0 (patch)
tree633a57af9b3aebb19cd8af75b0de3f1fc0a46b1a
parent68b7b897d0cc4ff052e83a0ef89cdf2f72c9d09c (diff)
downloadbuildstream-e97ba84077322afa8a29f3cbfc54c5e6c82873e0.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 31aa6001d..8058400fa 100644
--- a/buildstream/_scheduler/queues/fetchqueue.py
+++ b/buildstream/_scheduler/queues/fetchqueue.py
@@ -69,7 +69,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 21265d703..2e86cabb1 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1806,6 +1806,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