DEV: Don't destroy webhook in case of error
This commit is contained in:
parent
5b465ce053
commit
4c6bfb9b39
|
@ -113,15 +113,15 @@ module Jobs
|
||||||
response_body: response.body,
|
response_body: response.body,
|
||||||
duration: ((Time.zone.now - now) * 1000).to_i
|
duration: ((Time.zone.now - now) * 1000).to_i
|
||||||
)
|
)
|
||||||
|
rescue => e
|
||||||
MessageBus.publish("/web_hook_events/#{web_hook.id}", {
|
Rails.logger.error("Webhook event failed: #{e}")
|
||||||
web_hook_event_id: web_hook_event.id,
|
|
||||||
event_type: args[:event_type]
|
|
||||||
}, user_ids: User.human_users.staff.pluck(:id))
|
|
||||||
rescue
|
|
||||||
web_hook_event.destroy!
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
MessageBus.publish("/web_hook_events/#{web_hook.id}", {
|
||||||
|
web_hook_event_id: web_hook_event.id,
|
||||||
|
event_type: args[:event_type]
|
||||||
|
}, user_ids: User.human_users.staff.pluck(:id))
|
||||||
|
|
||||||
retry_web_hook if response&.status != 200
|
retry_web_hook if response&.status != 200
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue