summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrichardmaw-codethink <richard.maw@codethink.co.uk>2018-09-13 17:14:31 +0000
committerrichardmaw-codethink <richard.maw@codethink.co.uk>2018-09-13 17:14:31 +0000
commitfc7f83ac1d48e4d9684296153082ce32231bdcb0 (patch)
treed2bab6a607453509e52dd30951e846329814909c
parent3b81d4510656fcff808e4c37e29ac4a2f5e38de6 (diff)
parent559567621f55154e17fa19345dbd467e1f79a27c (diff)
downloadbuildstream-fc7f83ac1d48e4d9684296153082ce32231bdcb0.tar.gz
Merge branch 'richardmaw/element-cache-state-simplify' into 'master'
Simplify element state by removing `__cached` See merge request BuildStream/buildstream!784
-rw-r--r--buildstream/element.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 553973d0c..f484c88e5 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -200,7 +200,6 @@ class Element(Plugin):
self.__strict_cache_key = None # Our cached cache key for strict builds
self.__artifacts = artifacts # Artifact cache
self.__consistency = Consistency.INCONSISTENT # Cached overall consistency state
- self.__cached = None # Whether we have a cached artifact
self.__strong_cached = None # Whether we have a cached artifact
self.__weak_cached = None # Whether we have a cached artifact
self.__assemble_scheduled = False # Element is scheduled to be assembled
@@ -1126,8 +1125,6 @@ class Element(Plugin):
# Query caches now that the weak and strict cache keys are available
key_for_cache_lookup = self.__strict_cache_key if context.get_strict() else self.__weak_cache_key
- if not self.__cached:
- self.__cached = self.__artifacts.contains(self, key_for_cache_lookup)
if not self.__strong_cached:
self.__strong_cached = self.__artifacts.contains(self, self.__strict_cache_key)
if key_for_cache_lookup == self.__weak_cache_key:
@@ -2079,7 +2076,7 @@ class Element(Plugin):
def __is_cached(self, keystrength):
if keystrength is None:
- return self.__cached
+ keystrength = _KeyStrength.STRONG if self._get_context().get_strict() else _KeyStrength.WEAK
return self.__strong_cached if keystrength == _KeyStrength.STRONG else self.__weak_cached