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/db
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-06-29 13:26:37 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-07 16:08:15 +0300
commit825521539d26b6434fa8e15b07051c29bccba1c9 (patch)
tree0d0899b0c02ce6f572c68a7f8cf5ef1573324644 /db
parent316d8821cdcf048d08478b255060cf7645e33049 (diff)
Improve specs for background stage_id ref migration
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
index c54e8bde095..1d95fc62c87 100644
--- a/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
+++ b/db/post_migrate/20170628080858_migrate_stage_id_reference_in_background.rb
@@ -12,13 +12,12 @@ class MigrateStageIdReferenceInBackground < ActiveRecord::Migration
end
def up
- Build.where(stage_id: nil)
- .in_batches(of: BATCH_SIZE) do |relation, index|
- schedule = index * 5.minutes
- jobs = relation.pluck(:id).map { |id| [MIGRATION, [id]] }
+ Build.where(stage_id: nil).in_batches(of: BATCH_SIZE) do |relation, index|
+ schedule = index * 5.minutes
+ jobs = relation.pluck(:id).map { |id| [MIGRATION, [id]] }
- BackgroundMigrationWorker.perform_bulk_in(schedule, jobs)
- end
+ BackgroundMigrationWorker.perform_bulk_in(schedule, jobs)
+ end
end
def down