BigW Consortium Gitlab

delete_user_worker.rb 441 Bytes
Newer Older
1 2
class DeleteUserWorker
  include Sidekiq::Worker
3
  include DedicatedSidekiqQueue
4

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

9
    Users::DestroyService.new(current_user).execute(delete_user, options.symbolize_keys)
10 11
  rescue Gitlab::Access::AccessDeniedError => e
    Rails.logger.warn("User could not be destroyed: #{e}")
12 13
  end
end