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
|
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
|
2021-05-12 12:10:24 +00:00
|
|
|
integration = Integration.find(hook_id)
|
|
|
|
integration.execute(data)
|
2021-04-26 12:09:44 +00:00
|
|
|
rescue StandardError => error
|
2021-05-12 12:10:24 +00:00
|
|
|
integration_class = integration&.class&.name || "Not Found"
|
2021-07-14 18:08:31 +00:00
|
|
|
Gitlab::ErrorTracking.log_exception(error, integration_class: integration_class)
|
2014-12-07 10:29:37 +00:00
|
|
|
end
|
|
|
|
end
|