diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2018-07-17 13:05:51 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2018-07-18 15:07:24 +0900 |
commit | dc17de387961ba54c4742ba504ba7314c7da16aa (patch) | |
tree | c7f225c3586ee02419a4be03e288bd604af1020d /buildstream/_artifactcache/cascache.py | |
parent | 7229d2e5d03227f174ac359fd1a73ef50c071c5a (diff) | |
download | buildstream-dc17de387961ba54c4742ba504ba7314c7da16aa.tar.gz |
Clean the artifact cache when we hit the cache quota
When the cache quota is hit, we will remove any elements not required
for the current build, until our cache is only filled halfway.
Diffstat (limited to 'buildstream/_artifactcache/cascache.py')
-rw-r--r-- | buildstream/_artifactcache/cascache.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/buildstream/_artifactcache/cascache.py b/buildstream/_artifactcache/cascache.py index 4f1d8ac18..1e84c282f 100644 --- a/buildstream/_artifactcache/cascache.py +++ b/buildstream/_artifactcache/cascache.py @@ -450,6 +450,12 @@ class CASCache(ArtifactCache): except FileNotFoundError as e: raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e + def update_atime(self, ref): + try: + os.utime(self._refpath(ref)) + except FileNotFoundError as e: + raise ArtifactError("Attempt to access unavailable artifact: {}".format(e)) from e + def calculate_cache_size(self): if self.cache_size is None: self.cache_size = utils._get_dir_size(self.casdir) |