diff options
-rw-r--r-- | morphlib/plugins/gc_plugin.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/morphlib/plugins/gc_plugin.py b/morphlib/plugins/gc_plugin.py index 68f386eb..53abd8e2 100644 --- a/morphlib/plugins/gc_plugin.py +++ b/morphlib/plugins/gc_plugin.py @@ -1,4 +1,4 @@ -# Copyright (C) 2013-2014 Codethink Limited +# Copyright (C) 2013-2015 Codethink Limited # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -126,8 +126,8 @@ class GCPlugin(cliapp.Plugin): 'sufficient space already cleared', chatty=True) return - lac = morphlib.localartifactcache.LocalArtifactCache( - fs.osfs.OSFS(os.path.join(cache_path, 'artifacts'))) + lac = morphlib.ostreeartifactcache.OSTreeArtifactCache( + os.path.join(cache_path, 'artifacts')) max_age, min_age = self.calculate_delete_range() logging.debug('Must remove artifacts older than timestamp %d' % max_age) @@ -145,6 +145,8 @@ class GCPlugin(cliapp.Plugin): lac.remove(cachekey) removed += 1 + lac.prune() + # Maybe remove remaining middle-aged artifacts for cachekey in may_delete: if sufficient_free(): @@ -158,6 +160,8 @@ class GCPlugin(cliapp.Plugin): lac.remove(cachekey) removed += 1 + lac.prune() + if sufficient_free(): self.app.status(msg='Made sufficient space in %(cache_path)s ' 'after removing %(removed)d sources', |