You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by gi...@apache.org on 2020/12/29 13:20:18 UTC

[buildstream] 01/01: wip

This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch traveltissues/pushcached
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 58b6d585dc68e88c381c938cc80ab8de896b41d2
Author: Darius Makovsky <tr...@protonmail.com>
AuthorDate: Tue Jan 14 08:47:53 2020 +0000

    wip
---
 src/buildstream/element.py | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index ee6b90c..feabb33 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1097,9 +1097,14 @@ class Element(Plugin):
     #
     def _cached(self):
         if not self.__artifact:
+            self.__cached_successfully = None
             return False
 
-        return self.__artifact.cached()
+        if self.__artifact.cached():
+            self.__cached_successfully = True
+            return True
+        self.__cached_successfully = None
+        return False
 
     # _cached_remotely():
     #
@@ -1121,6 +1126,9 @@ class Element(Plugin):
     def _get_build_result(self):
         if self.__build_result is None:
             self.__load_build_result()
+        success, _, _ = self.__build_result
+        if success:
+            self._cached_successfully = True
 
         return self.__build_result
 
@@ -1153,12 +1161,8 @@ class Element(Plugin):
         if not self._cached():
             return False
 
-        success, _, _ = self._get_build_result()
-        if success:
-            self.__cached_successfully = True
-            return True
-        else:
-            return False
+        _, _, _ = self._get_build_result()
+        return bool(self.__cached_successfully)
 
     # _cached_failure():
     #
@@ -1170,8 +1174,8 @@ class Element(Plugin):
         if not self._cached():
             return False
 
-        success, _, _ = self._get_build_result()
-        return not success
+        _, _, _ = self._get_build_result()
+        return not bool(self.__cached_successfully)
 
     # _buildable():
     #