summaryrefslogtreecommitdiff
path: root/app/workers/hashed_storage/rollbacker_worker.rb
blob: d6a16b4d0836d34c3a689a4b6b217d7cf650f6d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# frozen_string_literal: true

module HashedStorage
  class RollbackerWorker # rubocop:disable Scalability/IdempotentWorker
    include ApplicationWorker

    data_consistency :always

    sidekiq_options retry: 3

    queue_namespace :hashed_storage
    feature_category :source_code_management

    # https://gitlab.com/gitlab-org/gitlab/-/issues/340629
    tags :needs_own_queue

    # @param [Integer] start initial ID of the batch
    # @param [Integer] finish last ID of the batch
    def perform(start, finish)
      migrator = Gitlab::HashedStorage::Migrator.new
      migrator.bulk_rollback(start: start, finish: finish)
    end
  end
end