Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib/tasks
diff options
context:
space:
mode:
authorJarka Kadlecová <jarka@gitlab.com>2018-07-30 21:14:38 +0300
committerJarka Kadlecová <jarka@gitlab.com>2018-08-07 13:51:58 +0300
commit6aaeb6dc411d6a92e9dc8d7968aa774c9e8ae044 (patch)
treef9877c182926456459693cd09c0aa63da21baa01 /lib/tasks
parentab08f9986de070b8d6bc15c36115653bc3ef3000 (diff)
Clean orphaned files in object storage
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/gitlab/cleanup.rake10
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