Files
fizzy/app/jobs/event/webhook_dispatch_job.rb
T
2025-09-16 20:03:57 +02:00

17 lines
371 B
Ruby

require "active_job/continuable"
class Event::WebhookDispatchJob < ApplicationJob
include ActiveJob::Continuable
queue_as :webhooks
def perform(event)
step :dispatch do |step|
Webhook.active.triggered_by(event).find_each(start: step.cursor) do |webhook|
webhook.trigger(event)
step.advance! from: webhook.id
end
end
end
end