Commit 3f482b0d authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'fix-36628-create-a-rake-task-to-cleanup-unused-lfs-files' into 'master'

Rake task gitlab:cleanup:orphan_lfs_files should clear the cached value or repository size

Closes #218394

See merge request gitlab-org/gitlab!32541
parents e1db24b5 9afbf5d1
---
title: Rake task gitlab:cleanup:orphan_lfs_files should clear the cached value or repository size
merge_request: 32541
author:
type: fixed
......@@ -34,6 +34,7 @@ describe Gitlab::Cleanup::OrphanLfsFileReferences do
it 'prints messages and deletes invalid reference' do
expect(null_logger).to receive(:info).with("Looking for orphan LFS files for project #{project.name_with_namespace}")
expect(null_logger).to receive(:info).with("Removed invalid references: 1")
expect(ProjectCacheWorker).to receive(:perform_async).with(project.id, [], [:lfs_objects_size])
expect { described_class.new(project, logger: null_logger, dry_run: false).run! }
.to change { project.lfs_objects.count }.from(2).to(1)
......
......@@ -35,6 +35,8 @@ module Gitlab
count += relation.delete_all
end
ProjectCacheWorker.perform_async(project.id, [], [:lfs_objects_size])
log_info("Removed invalid references: #{count}")
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment