diff options
author | Jarka Kadlecová <jarka@gitlab.com> | 2018-07-30 20:14:38 +0200 |
---|---|---|
committer | Jarka Kadlecová <jarka@gitlab.com> | 2018-08-07 12:51:58 +0200 |
commit | 6aaeb6dc411d6a92e9dc8d7968aa774c9e8ae044 (patch) | |
tree | f9877c182926456459693cd09c0aa63da21baa01 /lib/tasks | |
parent | ab08f9986de070b8d6bc15c36115653bc3ef3000 (diff) | |
download | gitlab-ce-6aaeb6dc411d6a92e9dc8d7968aa774c9e8ae044.tar.gz |
Clean orphaned files in object storage
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/cleanup.rake | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/cleanup.rake b/lib/tasks/gitlab/cleanup.rake index a2feb074b1d..c8a8863443e 100644 --- a/lib/tasks/gitlab/cleanup.rake +++ b/lib/tasks/gitlab/cleanup.rake @@ -116,6 +116,16 @@ namespace :gitlab do end end + desc 'GitLab | Cleanup | Clean orphan remote upload files that do not exist in the db' + task remote_upload_files: :environment do + cleaner = Gitlab::Cleanup::RemoteUploads.new(logger: logger) + cleaner.run!(dry_run: dry_run?) + + if dry_run? + logger.info "To cleanup these files run this command with DRY_RUN=false".color(:yellow) + end + end + def remove? ENV['REMOVE'] == 'true' end |