Commit 84175072 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Assign all pipeline workers to specific queues

parent 48776f27
......@@ -2,6 +2,8 @@ class ExpirePipelineCacheWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :cache
def perform(pipeline_id)
pipeline = Ci::Pipeline.find_by(id: pipeline_id)
return unless pipeline
......
......@@ -2,6 +2,8 @@ class PipelineHooksWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :hooks
def perform(pipeline_id)
Ci::Pipeline.find_by(id: pipeline_id)
.try(:execute_hooks)
......
......@@ -2,6 +2,8 @@ class PipelineMetricsWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :metrics
def perform(pipeline_id)
Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline|
update_metrics_for_active_pipeline(pipeline) if pipeline.active?
......
......@@ -2,6 +2,8 @@ class PipelineNotificationWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :hooks
def perform(pipeline_id, recipients = nil)
pipeline = Ci::Pipeline.find_by(id: pipeline_id)
......
......@@ -2,6 +2,8 @@ class PipelineProcessWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :processing
def perform(pipeline_id)
Ci::Pipeline.find_by(id: pipeline_id)
.try(:process!)
......
......@@ -2,6 +2,8 @@ class PipelineSuccessWorker
include Sidekiq::Worker
include PipelineQueue
enqueue_in group: :processing
def perform(pipeline_id)
Ci::Pipeline.find_by(id: pipeline_id).try do |pipeline|
MergeRequests::MergeWhenPipelineSucceedsService
......
......@@ -28,6 +28,9 @@
- [build, 2]
- [pipeline, 2]
- [pipeline_processing, 2]
- [pipeline_cache, 2]
- [pipeline_metrics, 2]
- [pipeline_hooks, 2]
- [gitlab_shell, 2]
- [email_receiver, 2]
- [emails_on_push, 2]
......
......@@ -43,4 +43,6 @@ describe ExpirePipelineCacheWorker do
subject.perform(pipeline.id)
end
end
it_behaves_like 'sidekiq worker'
end
......@@ -20,4 +20,6 @@ describe PipelineHooksWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
......@@ -47,4 +47,6 @@ describe PipelineMetricsWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
......@@ -16,4 +16,6 @@ describe PipelineNotificationWorker, :mailer do
subject.perform(Ci::Pipeline.maximum(:id).to_i.succ)
end
end
it_behaves_like 'sidekiq worker'
end
......@@ -19,4 +19,6 @@ describe PipelineProcessWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
......@@ -21,4 +21,6 @@ describe PipelineSuccessWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment