diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-26 11:55:20 +0300 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-08-26 11:55:20 +0300 |
commit | 15ace6a910ecb889c58fd4838a4f9a9b710178c7 (patch) | |
tree | 647da348e903d9acb86f6063e49d958f207ba874 /db | |
parent | e984a8a3543fa9a26308cea35a42046392f4a488 (diff) | |
parent | 2be34630623711fc20ef8c101b5cef688f207cc1 (diff) |
Merge commit '2be34630623711fc20ef8c101b5cef688f207cc1' into backstage/gb/rename-ci-cd-processing-sidekiq-queues
* commit '2be34630623711fc20ef8c101b5cef688f207cc1':
Common Docker Documentation Location in `gitlab-ce`
fix deprecation warning present during webpack compiles
Enable 5 lines of Sidekiq backtrace lines to aid in debugging
Add support for copying permalink to notes via more actions dropdown
Handle creating a nested group on MySQL correctly
Decrease statuses batch size even more in a migration
Fix repo editor scrollbar
Replace 'source/search_code.feature' spinach test with an rspec analog
Authorizations regarding OAuth - style confirmation
Update README.md
Refactor complicated API group finding rules into GroupsFinder
Fix group and project search for anonymous users
Document version Group Milestones API introduced
Allow v4 API GET requests for groups to be unauthenticated
Adjust a range and a size in stages statuses migration
Update README.md
Point to /developers on docs/administration/authentiq.md
Indexes GFM markdown guide
use inline links instead of referenced
Add index on ci_runners.contacted_at
Diffstat (limited to 'db')
-rw-r--r-- | db/post_migrate/20170711145558_migrate_stages_statuses.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/db/post_migrate/20170711145558_migrate_stages_statuses.rb b/db/post_migrate/20170711145558_migrate_stages_statuses.rb index 5a24fb1307f..aeb900354db 100644 --- a/db/post_migrate/20170711145558_migrate_stages_statuses.rb +++ b/db/post_migrate/20170711145558_migrate_stages_statuses.rb @@ -6,7 +6,7 @@ class MigrateStagesStatuses < ActiveRecord::Migration disable_ddl_transaction! BATCH_SIZE = 10000 - RANGE_SIZE = 1000 + RANGE_SIZE = 100 MIGRATION = 'MigrateStageStatus'.freeze class Stage < ActiveRecord::Base @@ -17,10 +17,10 @@ class MigrateStagesStatuses < ActiveRecord::Migration def up Stage.where(status: nil).each_batch(of: BATCH_SIZE) do |relation, index| relation.each_batch(of: RANGE_SIZE) do |batch| - range = relation.pluck('MIN(id)', 'MAX(id)').first - schedule = index * 5.minutes + range = batch.pluck('MIN(id)', 'MAX(id)').first + delay = index * 5.minutes - BackgroundMigrationWorker.perform_in(schedule, MIGRATION, range) + BackgroundMigrationWorker.perform_in(delay, MIGRATION, range) end end end |