2017-04-27 06:08:57 -04:00
|
|
|
class WebHookWorker
|
2013-01-24 15:15:24 -05:00
|
|
|
include Sidekiq::Worker
|
2016-10-21 12:13:41 -04:00
|
|
|
include DedicatedSidekiqQueue
|
2013-01-24 15:15:24 -05:00
|
|
|
|
2016-10-31 11:00:30 -04:00
|
|
|
sidekiq_options retry: 4
|
2013-01-24 15:15:24 -05:00
|
|
|
|
2015-01-23 19:10:43 -05:00
|
|
|
def perform(hook_id, data, hook_name)
|
2017-04-27 06:08:57 -04:00
|
|
|
hook = WebHook.find(hook_id)
|
2014-12-29 10:48:43 -05:00
|
|
|
data = data.with_indifferent_access
|
2017-04-27 06:08:57 -04:00
|
|
|
|
|
|
|
WebHookService.new(hook, data, hook_name).execute
|
2013-01-24 15:15:24 -05:00
|
|
|
end
|
|
|
|
end
|