mirror of
https://github.com/ditkrg/outboxable.git
synced 2026-01-23 06:16:46 +00:00
13 lines
352 B
Ruby
13 lines
352 B
Ruby
require 'sidekiq'
|
|
|
|
module Outboxable
|
|
class Worker
|
|
include ::Sidekiq::Job
|
|
|
|
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
|