diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2018-09-05 15:51:02 +0100 |
---|---|---|
committer | richardmaw-codethink <richard.maw@codethink.co.uk> | 2018-09-13 16:50:33 +0000 |
commit | 559567621f55154e17fa19345dbd467e1f79a27c (patch) | |
tree | d2bab6a607453509e52dd30951e846329814909c | |
parent | 3b81d4510656fcff808e4c37e29ac4a2f5e38de6 (diff) | |
download | buildstream-559567621f55154e17fa19345dbd467e1f79a27c.tar.gz |
element: Remove __cached field
This can get out of sync with other two cache states,
and we can do without it.
-rw-r--r-- | buildstream/element.py | 5 |
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 |