summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-04-29 15:35:15 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-04-29 15:35:15 +0000
commit68c8df44986cf0198f95ceb45b9a248e00f31f32 (patch)
tree8fd1e16c86b157c26a623db83049fe959ad8651c
parent73ef730ed9096c6ec418176f3d903d2483262b6b (diff)
parent7dc2b15ee4170decd56b9eac7da4781493980249 (diff)
downloadbuildstream-68c8df44986cf0198f95ceb45b9a248e00f31f32.tar.gz
Merge branch 'jonathan/reduce-update-state-calls' into 'master'
Reduce the amount of times we call Element._update_state() See merge request BuildStream/buildstream!1312
-rw-r--r--buildstream/element.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 05884c008..8cc25fec6 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1393,7 +1393,6 @@ class Element(Plugin):
#
def _schedule_tracking(self):
self.__tracking_scheduled = True
- self._update_state()
# _tracking_done():
#
@@ -1835,7 +1834,12 @@ class Element(Plugin):
def _fetch_done(self):
# We are not updating the state recursively here since fetching can
# never end up in updating them.
- self._update_state()
+
+ # Fetching changes the source state from RESOLVED to CACHED
+ # Fetching cannot change the source state from INCONSISTENT to CACHED because
+ # we prevent fetching when it's INCONSISTENT.
+ # Therefore, only the source state will change.
+ self.__update_source_state()
# _pull_pending()
#