2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class ProjectServiceWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2014-12-07 10:29:37 +00:00
|
|
|
|
2021-07-21 12:09:35 +00:00
|
|
|
data_consistency :always
|
2021-04-30 18:10:09 +00:00
|
|
|
sidekiq_options retry: 3
|
2017-07-17 15:38:02 +00:00
|
|
|
sidekiq_options dead: false
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :integrations
|
2021-07-26 18:09:51 +00:00
|
|
|
urgency :low
|
|
|
|
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_has_external_dependencies!
|
2017-07-17 15:38:02 +00:00
|
|
|
|
2014-12-07 10:29:37 +00:00
|
|
|
def perform(hook_id, data)
|
2014-12-29 15:48:43 +00:00
|
|
|
data = data.with_indifferent_access
|
2022-05-05 12:08:03 +00:00
|
|
|
integration = Integration.find_by_id(hook_id)
|
|
|
|
return unless integration
|
|
|
|
|
|
|
|
begin
|
|
|
|
integration.execute(data)
|
|
|
|
rescue StandardError => error
|
|
|
|
integration.log_exception(error)
|
|
|
|
end
|
2014-12-07 10:29:37 +00:00
|
|
|
end
|
|
|
|
end
|