2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class WebHookWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2013-01-24 20:15:24 +00:00
|
|
|
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :integrations
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_has_external_dependencies!
|
2020-06-12 12:08:56 +00:00
|
|
|
loggable_arguments 2
|
2019-10-30 15:14:17 +00:00
|
|
|
|
2017-07-17 15:38:02 +00:00
|
|
|
sidekiq_options retry: 4, dead: false
|
2013-01-24 20:15:24 +00:00
|
|
|
|
2015-01-24 00:10:43 +00:00
|
|
|
def perform(hook_id, data, hook_name)
|
2017-04-27 10:08:57 +00:00
|
|
|
hook = WebHook.find(hook_id)
|
2014-12-29 15:48:43 +00:00
|
|
|
data = data.with_indifferent_access
|
2017-04-27 10:08:57 +00:00
|
|
|
|
|
|
|
WebHookService.new(hook, data, hook_name).execute
|
2013-01-24 20:15:24 +00:00
|
|
|
end
|
|
|
|
end
|