diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:18 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-15 12:09:18 +0000 |
commit | b7c735c8ac11b8182807070fc6f84f2606e15427 (patch) | |
tree | e74b4d25abb8bbf23546f001dd94515e2840a3a3 /lib/tasks | |
parent | 221b529789f4090341a825695aeb49b8df6dd11d (diff) | |
download | gitlab-ce-b7c735c8ac11b8182807070fc6f84f2606e15427.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/uploads/legacy.rake | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/lib/tasks/gitlab/uploads/legacy.rake b/lib/tasks/gitlab/uploads/legacy.rake deleted file mode 100644 index 74db0060b8d..00000000000 --- a/lib/tasks/gitlab/uploads/legacy.rake +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true - -namespace :gitlab do - namespace :uploads do - namespace :legacy do - desc "GitLab | Uploads | Migrate all legacy attachments" - task migrate: :environment do - class Upload < ApplicationRecord - self.table_name = 'uploads' - - include ::EachBatch - end - - migration = 'LegacyUploadsMigrator' - batch_size = 5000 - delay_interval = 5.minutes.to_i - - Upload.where(uploader: 'AttachmentUploader', model_type: 'Note').each_batch(of: batch_size) do |relation, index| - start_id, end_id = relation.pluck('MIN(id), MAX(id)').first - delay = index * delay_interval - - BackgroundMigrationWorker.perform_in(delay, migration, [start_id, end_id]) - end - end - end - end -end |