Skip to content
Snippets Groups Projects
Commit 84175072 authored by Grzegorz Bizon's avatar Grzegorz Bizon
Browse files

Assign all pipeline workers to specific queues

parent 48776f27
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 0 deletions
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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)
Loading
Loading
Loading
Loading
@@ -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?
Loading
Loading
Loading
Loading
@@ -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)
 
Loading
Loading
Loading
Loading
@@ -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!)
Loading
Loading
Loading
Loading
@@ -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
Loading
Loading
Loading
Loading
@@ -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]
Loading
Loading
Loading
Loading
@@ -43,4 +43,6 @@ describe ExpirePipelineCacheWorker do
subject.perform(pipeline.id)
end
end
it_behaves_like 'sidekiq worker'
end
Loading
Loading
@@ -20,4 +20,6 @@ describe PipelineHooksWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
Loading
Loading
@@ -47,4 +47,6 @@ describe PipelineMetricsWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
Loading
Loading
@@ -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
Loading
Loading
@@ -19,4 +19,6 @@ describe PipelineProcessWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
Loading
Loading
@@ -21,4 +21,6 @@ describe PipelineSuccessWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment