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-21 11:13:57 +0000
commit7da7a7719754b1d206afcd1ac146e68851da4f7e (patch)
treeb41eaac1eaba53e47fa624ff8b3bd91f2fdc6f00
parent2203fd04054139017e971a8bbf9547c90fe5227f (diff)
downloadbuildstream-7da7a7719754b1d206afcd1ac146e68851da4f7e.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 0db395178..1c4cf78cf 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