about summary refs log tree commit diff
path: root/app/workers/trigger_webhook_worker.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/workers/trigger_webhook_worker.rb')
-rw-r--r--app/workers/trigger_webhook_worker.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/workers/trigger_webhook_worker.rb b/app/workers/trigger_webhook_worker.rb
new file mode 100644
index 000000000..2ffb6246f
--- /dev/null
+++ b/app/workers/trigger_webhook_worker.rb
@@ -0,0 +1,12 @@
+# frozen_string_literal: true
+
+class TriggerWebhookWorker
+  include Sidekiq::Worker
+
+  def perform(event, class_name, id)
+    object = class_name.constantize.find(id)
+    WebhookService.new.call(event, object)
+  rescue ActiveRecord::RecordNotFound
+    true
+  end
+end