diff options
author | Richard Maw <richard.maw@codethink.co.uk> | 2018-09-05 15:51:02 +0100 |
---|---|---|
committer | Richard Maw <richard.maw@codethink.co.uk> | 2018-09-05 18:17:36 +0100 |
commit | 723e7c21e414381698f8e4f46dbadf93df1d85d8 (patch) | |
tree | 7abdeb37301834a67984067e61532801aab92c6e | |
parent | 6a0cdedf0b2d5f17fcacddbb7c398d288111457f (diff) | |
download | buildstream-richardmaw/element-cache-state-simplify.tar.gz |
element: Remove __cached fieldrichardmaw/element-cache-state-simplify
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 ae8e10144..b6a539569 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -199,7 +199,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 @@ -1120,8 +1119,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: @@ -2085,7 +2082,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 |