summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-07-10 17:55:45 +0200
committerJürg Billeter <j@bitron.ch>2018-07-17 07:56:40 +0200
commit4b4c52689361a24534ad80fe2ee35123a6d98180 (patch)
treee10eeafd870753cbfaf02a4a2a37ea5950881a53
parent971606aed477fbdbb5efe54b000ff8e587d7c53e (diff)
downloadbuildstream-4b4c52689361a24534ad80fe2ee35123a6d98180.tar.gz
_artifactcache/casserver.py: Add update_mtime parameter to resolve_ref()
-rw-r--r--buildstream/_artifactcache/cascache.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py
index b7055a07f..a3fd16af4 100644
--- a/buildstream/_artifactcache/cascache.py
+++ b/buildstream/_artifactcache/cascache.py
@@ -431,15 +431,19 @@ class CASCache(ArtifactCache):
#
# Args:
# ref (str): The name of the ref
+ # update_mtime (bool): Whether to update the mtime of the ref
#
# Returns:
# (Digest): The digest stored in the ref
#
- def resolve_ref(self, ref):
+ def resolve_ref(self, ref, *, update_mtime=False):
refpath = self._refpath(ref)
try:
with open(refpath, 'rb') as f:
+ if update_mtime:
+ os.utime(refpath)
+
digest = remote_execution_pb2.Digest()
digest.ParseFromString(f.read())
return digest