Commit d676da49 authored by Tiago Gomes's avatar Tiago Gomes
Browse files

artifactcache: add some logging to cleanup operation

parent 83b5d55c
Loading
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -260,6 +260,14 @@ class ArtifactCache():
                # Remove the actual artifact, if it's not required.
                size = self.remove(to_remove)
                self._cache_size -= size
                self._message(MessageType.DEBUG,
                              "Removed artifact {} ({})".format(
                                  to_remove[:-(len(key) - self.context.log_key_length)],
                                  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

+2 −1
Original line number Diff line number Diff line
@@ -250,7 +250,8 @@ class Scheduler():
        artifacts = Platform.get_platform().artifactcache

        if artifacts.has_get_quota_exceeded():
            job = CleanupJob(self, 'cleanup', 'cleanup/cleanup',
            job = CleanupJob(self, 'Clean artifact cache',
                             'cleanup/cleanup',
                             resources=[ResourceType.CACHE,
                                        ResourceType.PROCESS],
                             exclusive_resources=[ResourceType.CACHE])