Class: ActiveWebhook::Queueing::SidekiqAdapter::SubscriptionWorker

Inherits:
Object
  • Object
show all
Includes:
Sidekiq::Worker
Defined in:
lib/active_webhook/queueing/sidekiq_adapter.rb

Instance Method Summary collapse

Instance Method Details

#perform(subscription, hook, context) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/active_webhook/queueing/sidekiq_adapter.rb', line 11

def perform(subscription, hook, context)
  subscription = ActiveWebhook.subscription_model.find_by(id: subscription)
  hook = Hook.from_h(hook.symbolize_keys) unless hook.nil?

  ActiveWebhook.queueing_adapter.fulfill_subscription(
    subscription: subscription,
    hook: hook,
    job_id: jid,
    **context.symbolize_keys
  )
end