lib/outboxable/worker.rb in outboxable-1.0.0 vs lib/outboxable/worker.rb in outboxable-1.0.2
- old
+ new
@@ -2,10 +2,11 @@
module Outboxable
class Worker
include ::Sidekiq::Job
- def perform(outbox_id)
- Outboxable::PublishingManager.publish(resource: Outbox.find(outbox_id))
+ def perform(outbox_id, orm)
+ Outboxable::PublishingManager.publish(resource: Outbox.find(outbox_id)) if orm == 'activerecord'
+ Outboxable::PublishingManager.publish(resource: Outbox.find_by!(idempotency_key: outbox_id)) if orm == 'mongoid'
end
end
end