summaryrefslogtreecommitdiff
path: root/internal/cleaner/media.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/cleaner/media.go')
-rw-r--r--internal/cleaner/media.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/cleaner/media.go b/internal/cleaner/media.go
index 99fd5779f..bd02cb2a3 100644
--- a/internal/cleaner/media.go
+++ b/internal/cleaner/media.go
@@ -44,10 +44,16 @@ func (m *Media) All(ctx context.Context, maxRemoteDays int) {
m.LogUncacheRemote(ctx, t)
m.LogPruneOrphaned(ctx)
m.LogPruneUnused(ctx)
- m.LogFixCacheStates(ctx)
_ = m.state.Storage.Storage.Clean(ctx)
}
+// AllAndFix calls LogFixCacheStates(), followed by All(), it
+// is done this way round so Storage.Clean() is performed last.
+func (m *Media) AllAndFix(ctx context.Context, maxRemoteDays int) {
+ m.LogFixCacheStates(ctx)
+ m.All(ctx, maxRemoteDays)
+}
+
// LogUncacheRemote performs Media.UncacheRemote(...), logging the start and outcome.
func (m *Media) LogUncacheRemote(ctx context.Context, olderThan time.Time) {
log.Infof(ctx, "start older than: %s", olderThan.Format(time.Stamp))