2015-07-14 16:44:35 -07:00
|
|
|
class DeletionWorker
|
|
|
|
include Sidekiq::Worker
|
|
|
|
|
2015-07-26 23:59:56 -07:00
|
|
|
sidekiq_options queue: :deletion, retry: false
|
2015-07-14 16:44:35 -07:00
|
|
|
|
|
|
|
# @param resource_id [Integer] user id passed from Devise
|
|
|
|
def perform(resource_id)
|
|
|
|
begin
|
|
|
|
User.find(resource_id).destroy!
|
|
|
|
rescue => e
|
2015-07-27 00:18:10 -07:00
|
|
|
logger.info "failed to delete user: #{e.message}"
|
2017-03-31 14:17:36 -07:00
|
|
|
Rollbar.error(e)
|
2015-07-14 16:44:35 -07:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|