diff options
author | Jürg Billeter <j@bitron.ch> | 2018-10-17 17:08:44 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-10-17 17:15:54 +0100 |
commit | 63360244450960599580245980b552314301d504 (patch) | |
tree | 142cdf0e53b983b1864c31bdc7476fb1472a8775 | |
parent | eeb334f2ad349cb48e7c4ac0f2daf5a4984c97af (diff) | |
download | buildstream-63360244450960599580245980b552314301d504.tar.gz |
_artifactcache: Rename update_atime() to update_mtime()
os.utime() updates both, however, list_artifacts() sorts refs by mtime,
i.e., atime is irrelevant.
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 12 | ||||
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index ecb5738d7..443905c63 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -227,7 +227,7 @@ class ArtifactCache(): self._required_elements.update(elements) # For the cache keys which were resolved so far, we bump - # the atime of them. + # the mtime of them. # # This is just in case we have concurrent instances of # BuildStream running with the same artifact cache, it will @@ -239,7 +239,7 @@ class ArtifactCache(): for key in (strong_key, weak_key): if key: try: - self.update_atime(key) + self.update_mtime(key) except ArtifactError: pass @@ -390,15 +390,15 @@ class ArtifactCache(): def preflight(self): pass - # update_atime() + # update_mtime() # - # Update the atime of an artifact. + # Update the mtime of an artifact. # # Args: # key (str): The key of the artifact. # - def update_atime(self, key): - raise ImplError("Cache '{kind}' does not implement contains()" + def update_mtime(self, key): + raise ImplError("Cache '{kind}' does not implement update_mtime()" .format(kind=type(self).__name__)) # initialize_remotes(): diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index ed6d58821..8fb2e8b01 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -538,7 +538,7 @@ class CASCache(ArtifactCache): except FileNotFoundError as e: raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e - def update_atime(self, ref): + def update_mtime(self, ref): try: os.utime(self._refpath(ref)) except FileNotFoundError as e: |