summaryrefslogtreecommitdiff
path: root/src/buildstream/_artifact.py
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2019-11-19 21:06:36 +0100
committerJürg Billeter <j@bitron.ch>2020-01-18 10:46:52 +0000
commita5ee014f03171ec9f9319c6956e0f832cc446188 (patch)
tree67f926ce359dc7240b75a109e88ba9928b0504e1 /src/buildstream/_artifact.py
parentcdb562771fa2e5554562b0f799197e342d8a927f (diff)
downloadbuildstream-a5ee014f03171ec9f9319c6956e0f832cc446188.tar.gz
element.py: Optimize assemble_done()
After a successful build we know that the artifact is cached. Avoid querying buildbox-casd and the filesystem.
Diffstat (limited to 'src/buildstream/_artifact.py')
-rw-r--r--src/buildstream/_artifact.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/buildstream/_artifact.py b/src/buildstream/_artifact.py
index feba3898b..ae1b395b3 100644
--- a/src/buildstream/_artifact.py
+++ b/src/buildstream/_artifact.py
@@ -459,6 +459,14 @@ class Artifact:
def reset_cached(self):
self._cached = None
+ # set_cached()
+ #
+ # Mark the artifact as cached without querying the filesystem.
+ # This is used as optimization when we know the artifact is available.
+ #
+ def set_cached(self):
+ self._cached = True
+
# _get_proto()
#
# Returns: