Retrospring/app/workers/deletion_worker.rb

15 lines
316 B
Ruby
Raw Normal View History

class DeletionWorker
include Sidekiq::Worker
sidekiq_options queue: :deletion
# @param resource_id [Integer] user id passed from Devise
def perform(resource_id)
begin
User.find(resource_id).destroy!
rescue => e
Rails.logger.error "failed to delete user: #{e.message}"
end
end
end