diff options
-rw-r--r-- | app/workers/concerns/pipeline_queue.rb | 8 | ||||
-rw-r--r-- | app/workers/pipeline_update_worker.rb | 2 | ||||
-rw-r--r-- | config/sidekiq_queues.yml | 2 | ||||
-rw-r--r-- | spec/workers/concerns/pipeline_queue_spec.rb | 8 |
4 files changed, 10 insertions, 10 deletions
diff --git a/app/workers/concerns/pipeline_queue.rb b/app/workers/concerns/pipeline_queue.rb index ed882e3ecef..ddf45b91345 100644 --- a/app/workers/concerns/pipeline_queue.rb +++ b/app/workers/concerns/pipeline_queue.rb @@ -5,14 +5,14 @@ module PipelineQueue extend ActiveSupport::Concern included do - sidekiq_options queue: 'pipelines-default' + sidekiq_options queue: 'pipeline_default' end class_methods do - def enqueue_in(queue:, group:) - raise ArgumentError if queue.empty? || group.empty? + def enqueue_in(group:) + raise ArgumentError, 'Unspecified queue group!' if group.empty? - sidekiq_options queue: "pipelines-#{queue}-#{group}" + sidekiq_options queue: "pipeline_#{group}" end end end diff --git a/app/workers/pipeline_update_worker.rb b/app/workers/pipeline_update_worker.rb index 086d00b7ec8..5fa399dff4c 100644 --- a/app/workers/pipeline_update_worker.rb +++ b/app/workers/pipeline_update_worker.rb @@ -2,7 +2,7 @@ class PipelineUpdateWorker include Sidekiq::Worker include PipelineQueue - enqueue_in queue: :pipeline, group: :processing + enqueue_in group: :processing def perform(pipeline_id) Ci::Pipeline.find_by(id: pipeline_id) diff --git a/config/sidekiq_queues.yml b/config/sidekiq_queues.yml index 7816c0fa92e..8e13ed95f19 100644 --- a/config/sidekiq_queues.yml +++ b/config/sidekiq_queues.yml @@ -27,7 +27,7 @@ - [new_merge_request, 2] - [build, 2] - [pipeline, 2] - - [pipelines-pipeline-processing, 2] + - [pipeline_processing, 2] - [gitlab_shell, 2] - [email_receiver, 2] - [emails_on_push, 2] diff --git a/spec/workers/concerns/pipeline_queue_spec.rb b/spec/workers/concerns/pipeline_queue_spec.rb index 3049f2b2ab4..eac5a770e5f 100644 --- a/spec/workers/concerns/pipeline_queue_spec.rb +++ b/spec/workers/concerns/pipeline_queue_spec.rb @@ -10,15 +10,15 @@ describe PipelineQueue do it 'sets a default pipelines queue automatically' do expect(worker.sidekiq_options['queue']) - .to eq 'pipelines-default' + .to eq 'pipeline_default' end describe '.enqueue_in' do - it 'sets a custom sidekiq queue with prefix, name and group' do - worker.enqueue_in(queue: :build, group: :processing) + it 'sets a custom sidekiq queue with prefix and group' do + worker.enqueue_in(group: :processing) expect(worker.sidekiq_options['queue']) - .to eq 'pipelines-build-processing' + .to eq 'pipeline_processing' end end end |