mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-19 07:32:34 +08:00
19 lines
463 B
Ruby
19 lines
463 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Activities
|
|
class DispatchWebhooksJob < ApplicationJob
|
|
queue_as :high_priority
|
|
|
|
def perform(activity)
|
|
webhooks =
|
|
Webhook.active.where(
|
|
activity_filter_id:
|
|
Activities::ActivityFilterMatchingService.new(activity).activity_filters.select(:id)
|
|
)
|
|
|
|
webhooks.each do |webhook|
|
|
Activities::SendWebhookJob.perform_later(webhook, activity)
|
|
end
|
|
end
|
|
end
|
|
end
|