Class: Metova::WebhookJob
- Inherits:
-
ActiveJob::Base
- Object
- ActiveJob::Base
- Metova::WebhookJob
- Defined in:
- app/job/metova/webhook_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(event, payload) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/job/metova/webhook_job.rb', line 5 def perform(event, payload) Webhook.where(event: event).each do |webhook| begin url = URI.parse(webhook.url) Net::HTTP.post_form url, JSON.parse(payload) rescue Exception => e Rails.logger.error e. end end end |