Class: DeleteUserWorker

Inherits:
Object
  • Object
show all
Includes:
ApplicationWorker
Defined in:
app/workers/delete_user_worker.rb

Overview

rubocop:disable Scalability/IdempotentWorker

Constant Summary

Constants included from ApplicationWorker

ApplicationWorker::LOGGING_EXTRA_KEY

Constants included from WorkerAttributes

WorkerAttributes::NAMESPACE_WEIGHTS, WorkerAttributes::VALID_RESOURCE_BOUNDARIES, WorkerAttributes::VALID_URGENCIES

Instance Method Summary collapse

Methods included from Gitlab::SidekiqVersioning::Worker

#job_version

Methods included from WorkerContext

#with_context

Instance Method Details

#perform(current_user_id, delete_user_id, options = {}) ⇒ Object


9
10
11
12
13
14
15
16
# File 'app/workers/delete_user_worker.rb', line 9

def perform(current_user_id, delete_user_id, options = {})
  delete_user  = User.find(delete_user_id)
  current_user = User.find(current_user_id)

  Users::DestroyService.new(current_user).execute(delete_user, options.symbolize_keys)
rescue Gitlab::Access::AccessDeniedError => e
  Gitlab::AppLogger.warn("User could not be destroyed: #{e}")
end