diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb')
-rw-r--r-- | db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb new file mode 100644 index 00000000000..b14a9ab88b9 --- /dev/null +++ b/db/post_migrate/20211006060436_schedule_populate_topics_total_projects_count_cache.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SchedulePopulateTopicsTotalProjectsCountCache < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTopicsTotalProjectsCountCache' + 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 |