diff options
author | Jürg Billeter <j@bitron.ch> | 2019-03-12 12:08:22 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2019-03-25 10:24:41 +0100 |
commit | 808fdc3528352de746100b9237ec4ac84897b251 (patch) | |
tree | 17986e5ef9ee8bffb55098071fcdfb5e065eeee2 /buildstream/element.py | |
parent | ee73624c7ad0353e439e12c752c55fd59d207cb4 (diff) | |
download | buildstream-808fdc3528352de746100b9237ec4ac84897b251.tar.gz |
_artifact.py: Add cached() helper method
Current logic is trivial but will be expanded to support partial CAS.
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index dbd063b2d..33d996f80 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -1200,7 +1200,7 @@ class Element(Plugin): return if not context.get_strict(): - self.__weak_cached = self.__artifacts.contains(self, self.__weak_cache_key) + self.__weak_cached = self.__artifact.cached(self.__weak_cache_key) if not context.get_strict(): # Full cache query in non-strict mode requires both the weak and @@ -1230,10 +1230,10 @@ 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.__strong_cached: - self.__strong_cached = self.__artifacts.contains(self, self.__strict_cache_key) + self.__strong_cached = self.__artifact.cached(self.__strict_cache_key) if key_for_cache_lookup == self.__weak_cache_key: if not self.__weak_cached: - self.__weak_cached = self.__artifacts.contains(self, self.__weak_cache_key) + self.__weak_cached = self.__artifact.cached(self.__weak_cache_key) if (not self.__assemble_scheduled and not self.__assemble_done and not self._cached_success() and not self._pull_pending()): |