diff options
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 5 | ||||
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index c6c8afa80..5e698babb 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -240,7 +240,7 @@ class ArtifactCache(): for key in (strong_key, weak_key): if key: try: - self.update_mtime(key) + self.update_mtime(element, key) except ArtifactError: pass @@ -396,9 +396,10 @@ class ArtifactCache(): # Update the mtime of an artifact. # # Args: + # element (Element): The Element to update # key (str): The key of the artifact. # - def update_mtime(self, key): + def update_mtime(self, element, key): raise ImplError("Cache '{kind}' does not implement update_mtime()" .format(kind=type(self).__name__)) diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 8fb2e8b01..2454366ac 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -538,8 +538,9 @@ class CASCache(ArtifactCache): except FileNotFoundError as e: raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e - def update_mtime(self, ref): + def update_mtime(self, element, key): try: + ref = self.get_artifact_fullname(element, key) os.utime(self._refpath(ref)) except FileNotFoundError as e: raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e |