Welcome to mirror list, hosted at ThFree Co, Russian Federation.

migrate_records_to_ghost_user_in_batches_worker.rb « users « workers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ddddfc106aee37f97ab6b1b32358567dbf353592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# frozen_string_literal: true

module Users
  class MigrateRecordsToGhostUserInBatchesWorker
    include ApplicationWorker
    include Gitlab::ExclusiveLeaseHelpers
    include CronjobQueue # rubocop: disable Scalability/CronWorkerContext

    sidekiq_options retry: false
    feature_category :users
    data_consistency :always
    idempotent!

    def perform
      return unless Feature.enabled?(:user_destroy_with_limited_execution_time_worker)

      in_lock(self.class.name.underscore, ttl: Gitlab::Utils::ExecutionTracker::MAX_RUNTIME, retries: 0) do
        Users::MigrateRecordsToGhostUserInBatchesService.new.execute
      end
    end
  end
end