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