2016-02-17 08:41:33 -05:00
|
|
|
class DeleteUserWorker
|
|
|
|
include Sidekiq::Worker
|
2016-10-21 12:13:41 -04:00
|
|
|
include DedicatedSidekiqQueue
|
2016-02-17 08:41:33 -05:00
|
|
|
|
2016-02-25 03:20:28 -05:00
|
|
|
def perform(current_user_id, delete_user_id, options = {})
|
2016-02-17 08:41:33 -05:00
|
|
|
delete_user = User.find(delete_user_id)
|
|
|
|
current_user = User.find(current_user_id)
|
|
|
|
|
2016-08-13 08:45:31 -04:00
|
|
|
Users::DestroyService.new(current_user).execute(delete_user, options.symbolize_keys)
|
2017-02-04 03:14:17 -05:00
|
|
|
rescue Gitlab::Access::AccessDeniedError => e
|
|
|
|
Rails.logger.warn("User could not be destroyed: #{e}")
|
2016-02-17 08:41:33 -05:00
|
|
|
end
|
|
|
|
end
|