Class: Gitlab::BackgroundMigration::BackfillUpvotesCountOnIssues

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb

Overview

Class that will populate the upvotes_count field for each issue

Constant Summary collapse

BATCH_SIZE =
1_000

Instance Method Summary collapse

Instance Method Details

#perform(start_id, stop_id) ⇒ Object


10
11
12
13
14
# File 'lib/gitlab/background_migration/backfill_upvotes_count_on_issues.rb', line 10

def perform(start_id, stop_id)
  (start_id..stop_id).step(BATCH_SIZE).each do |offset|
    update_issue_upvotes_count(offset, offset + BATCH_SIZE)
  end
end