Remove sidekiq build queue and assign pipeline queue

This commit is contained in:
Grzegorz Bizon 2017-08-21 14:16:51 +02:00
parent 8417507201
commit 4c93668202
12 changed files with 25 additions and 27 deletions

View file

@ -1,6 +1,8 @@
class BuildCoverageWorker
include Sidekiq::Worker
include BuildQueue
include PipelineQueue
enqueue_in group: :processing
def perform(build_id)
Ci::Build.find_by(id: build_id)&.update_coverage

View file

@ -1,6 +1,8 @@
class BuildFinishedWorker
include Sidekiq::Worker
include BuildQueue
include PipelineQueue
enqueue_in group: :processing
def perform(build_id)
Ci::Build.find_by(id: build_id).try do |build|

View file

@ -1,6 +1,8 @@
class BuildHooksWorker
include Sidekiq::Worker
include BuildQueue
include PipelineQueue
enqueue_in group: :hooks
def perform(build_id)
Ci::Build.find_by(id: build_id)

View file

@ -1,6 +1,8 @@
class BuildSuccessWorker
include Sidekiq::Worker
include BuildQueue
include PipelineQueue
enqueue_in group: :processing
def perform(build_id)
Ci::Build.find_by(id: build_id).try do |build|

View file

@ -1,8 +0,0 @@
# Concern for setting Sidekiq settings for the various CI build workers.
module BuildQueue
extend ActiveSupport::Concern
included do
sidekiq_options queue: :build
end
end

View file

@ -1,6 +1,8 @@
class ExpireJobCacheWorker
include Sidekiq::Worker
include BuildQueue
include PipelineQueue
enqueue_in group: :cache
def perform(job_id)
job = CommitStatus.joins(:pipeline, :project).find_by(id: job_id)

View file

@ -20,4 +20,6 @@ describe BuildCoverageWorker do
end
end
end
it_behaves_like 'sidekiq_worker'
end

View file

@ -27,4 +27,6 @@ describe BuildFinishedWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end

View file

@ -20,4 +20,6 @@ describe BuildHooksWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end

View file

@ -33,4 +33,6 @@ describe BuildSuccessWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end

View file

@ -1,14 +0,0 @@
require 'spec_helper'
describe BuildQueue do
let(:worker) do
Class.new do
include Sidekiq::Worker
include BuildQueue
end
end
it 'sets the queue name of a worker' do
expect(worker.sidekiq_options['queue'].to_s).to eq('build')
end
end

View file

@ -28,4 +28,6 @@ describe ExpireJobCacheWorker do
end
end
end
it_behaves_like 'sidekiq worker'
end