diff options
-rw-r--r-- | src/buildstream/element.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py index c41fa60b1..e19b3f17e 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -1129,12 +1129,14 @@ class Element(Plugin): # (bool): Whether this element is already present in # the artifact cache # - def _cached(self) -> None: + def _cached(self) -> bool: if not self.__artifact: self.__cached_successfully = False - return + return False if self.__artifact_cached(): self.__cached_successfully = True + return True + return False # _cached_remotely(): # @@ -1177,16 +1179,14 @@ class Element(Plugin): # (bool): Whether this element is already present in # the artifact cache and the element assembled successfully # - def _cached_success(self) -> None: + def _cached_success(self) -> bool: # FIXME: _cache() and _cached_success() should be converted to # push based functions where we only update __cached_successfully # once we know this has changed. This will allow us to cheaply check # __cached_successfully instead of calling _cached_success() if self.__cached_successfully: - return - - self._cached(): - + return True + self._cached() success, _, _ = self._get_build_result() if success: self.__cached_successfully = True |