diff options
Diffstat (limited to 'app/workers/users/migrate_records_to_ghost_user_in_batches_worker.rb')
-rw-r--r-- | app/workers/users/migrate_records_to_ghost_user_in_batches_worker.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/app/workers/users/migrate_records_to_ghost_user_in_batches_worker.rb b/app/workers/users/migrate_records_to_ghost_user_in_batches_worker.rb new file mode 100644 index 00000000000..ddddfc106ae --- /dev/null +++ b/app/workers/users/migrate_records_to_ghost_user_in_batches_worker.rb @@ -0,0 +1,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 |