2018-06-27 07:23:28 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-02-19 18:09:10 +00:00
|
|
|
class BuildHooksWorker # rubocop:disable Scalability/IdempotentWorker
|
2017-11-28 16:08:30 +00:00
|
|
|
include ApplicationWorker
|
2017-08-21 12:16:51 +00:00
|
|
|
include PipelineQueue
|
|
|
|
|
2017-11-28 16:16:50 +00:00
|
|
|
queue_namespace :pipeline_hooks
|
2019-10-18 11:11:44 +00:00
|
|
|
feature_category :continuous_integration
|
2020-03-02 18:07:42 +00:00
|
|
|
urgency :high
|
2021-03-26 18:09:16 +00:00
|
|
|
data_consistency :delayed, feature_flag: :load_balancing_for_build_hooks_worker
|
2016-10-13 10:45:16 +00:00
|
|
|
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
2016-10-13 10:45:16 +00:00
|
|
|
def perform(build_id)
|
2021-01-22 15:09:08 +00:00
|
|
|
Ci::Build.includes({ runner: :tags })
|
|
|
|
.find_by(id: build_id)
|
2016-10-13 10:45:16 +00:00
|
|
|
.try(:execute_hooks)
|
|
|
|
end
|
2018-08-27 15:31:01 +00:00
|
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
2016-10-13 10:45:16 +00:00
|
|
|
end
|