diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-18 09:45:46 +0000 |
commit | a7b3560714b4d9cc4ab32dffcd1f74a284b93580 (patch) | |
tree | 7452bd5c3545c2fa67a28aa013835fb4fa071baf /db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb | |
parent | ee9173579ae56a3dbfe5afe9f9410c65bb327ca7 (diff) | |
download | gitlab-ce-a7b3560714b4d9cc4ab32dffcd1f74a284b93580.tar.gz |
Add latest changes from gitlab-org/gitlab@14-8-stable-eev14.8.0-rc42
Diffstat (limited to 'db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb')
-rw-r--r-- | db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb b/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb new file mode 100644 index 00000000000..dee86a70553 --- /dev/null +++ b/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SchedulePopulateTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTopicsNonPrivateProjectsCount' + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('topics'), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end |