diff options
author | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2018-08-13 17:00:04 +0100 |
---|---|---|
committer | Tiago Gomes <tiago.gomes@codethink.co.uk> | 2018-08-13 17:19:10 +0100 |
commit | b219b0c1b11d1c8810a173524ee5647035e8f9b1 (patch) | |
tree | ffcb9efe8987fb90235e71095174c85a2a10adf4 | |
parent | 31ed215dbc1d9ae716911aac78fa25a14a46fb2f (diff) | |
download | buildstream-tiagogomes/cache-calculation-revamp.tar.gz |
artifactcache: add some logging to cleanup operationtiagogomes/cache-calculation-revamp
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 10 | ||||
-rw-r--r-- | buildstream/_scheduler/scheduler.py | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index 22965feca..61024fa6e 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -251,8 +251,14 @@ class ArtifactCache(): key = to_remove.rpartition('/')[2] if key not in self.required_artifacts: size = self.remove(to_remove) - if size: - self.cache_size -= size + self.cache_size -= size + self._message(MessageType.INFO, + "Removed artifact {} ({})".format( + key[:7], utils._pretty_size(size))) + + self._message(MessageType.INFO, + "New artifact cache size: {}".format( + utils._pretty_size(self.cache_size))) return old_cache_size - self.cache_size diff --git a/buildstream/_scheduler/scheduler.py b/buildstream/_scheduler/scheduler.py index fcde38a80..ffbdf8bd5 100644 --- a/buildstream/_scheduler/scheduler.py +++ b/buildstream/_scheduler/scheduler.py @@ -316,7 +316,7 @@ class Scheduler(): self._sched() def _run_cache_cleanup(self): - job = CleanupJob(self, 'cleanup', 'cleanup', + job = CleanupJob(self, 'Cleaning artifact cache', 'cleanup', resources=[ResourceType.CACHE, ResourceType.PROCESS], exclusive_resources=[ResourceType.CACHE]) |