diaspora/app/workers/export_user.rb
Jason Robinson 78299c9e2f Consolidate amount of sidekiq queues from 13 to 5
Sidekiq documentation says 'Sidekiq is not designed to work well with dozens of queues.'. Having the amount of queues we have at the moment brings no anyway.

Closes #5571
2016-08-10 08:51:22 +00:00

21 lines
518 B
Ruby

# Copyright (c) 2010-2011, Diaspora Inc. This file is
# licensed under the Affero General Public License version 3 or later. See
# the COPYRIGHT file.
module Workers
class ExportUser < Base
sidekiq_options queue: :low
def perform(user_id)
@user = User.find(user_id)
@user.perform_export!
if @user.reload.export.present?
ExportMailer.export_complete_for(@user).deliver_now
else
ExportMailer.export_failure_for(@user).deliver_now
end
end
end
end