project_service_worker.rb 596 Bytes
Newer Older
1 2
# frozen_string_literal: true

3
class ProjectServiceWorker # rubocop:disable Scalability/IdempotentWorker
4
  include ApplicationWorker
5

6 7
  sidekiq_options retry: 3

8
  sidekiq_options dead: false
9
  feature_category :integrations
10
  worker_has_external_dependencies!
11

12
  def perform(hook_id, data)
13
    data = data.with_indifferent_access
14 15
    integration = Integration.find(hook_id)
    integration.execute(data)
16
  rescue StandardError => error
17
    integration_class = integration&.class&.name || "Not Found"
18
    Gitlab::ErrorTracking.log_exception(error, integration_class: integration_class)
19 20
  end
end