summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarius Makovsky <traveltissues@protonmail.com>2020-01-14 08:47:53 +0000
committerDarius Makovsky <traveltissues@protonmail.com>2020-01-14 08:47:53 +0000
commit58b6d585dc68e88c381c938cc80ab8de896b41d2 (patch)
tree102b785345124e5f2ab7308f1264197f64710b05
parent55ed6b5f63b9bc34beedf73f3aa288c9fa215f5c (diff)
downloadbuildstream-traveltissues/pushcached.tar.gz
-rw-r--r--src/buildstream/element.py22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index ee6b90ce7..feabb332f 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():
#