Class: Webhookdb::Jobs::WebhookSubscriptionDeliveryEvent

Inherits:
Object
  • Object
show all
Includes:
Amigo::DurableJob, Amigo::QueueBackoffJob, Sidekiq::Worker
Defined in:
lib/webhookdb/jobs/webhook_subscription_delivery_attempt.rb

Instance Method Summary collapse

Methods included from Amigo::DurableJob

enabled?, ensure_jobs_tables, heartbeat, heartbeat!, included, insert_job, lock_job, poll_jobs, reconnect, replace_database_settings, set_database_setting, storage_datasets, unlock_job

Instance Method Details

#dependent_queuesObject



15
16
17
# File 'lib/webhookdb/jobs/webhook_subscription_delivery_attempt.rb', line 15

def dependent_queues
  return ["critical"]
end

#perform(delivery_id) ⇒ Object



19
20
21
22
23
24
25
26
27
28
# File 'lib/webhookdb/jobs/webhook_subscription_delivery_attempt.rb', line 19

def perform(delivery_id)
  delivery = Webhookdb::WebhookSubscription::Delivery[delivery_id]
  Webhookdb::Async::JobLogger.with_log_tags(
    webhook_subscription_delivery_id: delivery.id,
    webhook_subscription_id: delivery.webhook_subscription_id,
    organization_key: delivery.webhook_subscription.fetch_organization,
  ) do
    delivery.attempt_delivery
  end
end