diaspora/app/workers/receive_local.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

14 lines
449 B
Ruby

module Workers
class ReceiveLocal < Base
sidekiq_options queue: :high
def perform(object_class_string, object_id, recipient_user_ids)
object = object_class_string.constantize.find(object_id)
object.receive(recipient_user_ids) if object.respond_to?(:receive)
NotificationService.new.notify(object, recipient_user_ids)
rescue ActiveRecord::RecordNotFound # Already deleted before the job could run
end
end
end