2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class PipelineHooksWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2021-04-30 18:10:09 +00:00
|
|
|
|
|
|
|
sidekiq_options retry: 3
|
2016-10-21 16:13:41 +00:00
|
|
|
include PipelineQueue
|
2016-10-12 11:44:33 +00:00
|
|
|
|
2017-11-28 16:16:50 +00:00
|
|
|
queue_namespace :pipeline_hooks
|
2019-10-30 15:14:17 +00:00
|
|
|
worker_resource_boundary :cpu
|
2021-06-17 18:10:22 +00:00
|
|
|
data_consistency :delayed
|
2017-08-21 12:02:20 +00:00
|
|
|
|
2016-10-12 11:44:33 +00:00
|
|
|
def perform(pipeline_id)
|
2021-11-10 15:13:21 +00:00
|
|
|
pipeline = Ci::Pipeline.find_by_id(pipeline_id)
|
2021-10-08 12:11:10 +00:00
|
|
|
return unless pipeline
|
|
|
|
|
|
|
|
Ci::Pipelines::HookService.new(pipeline).execute
|
2016-10-12 11:44:33 +00:00
|
|
|
end
|
|
|
|
end
|