Remove sidekiq build queue and assign pipeline queue
This commit is contained in:
parent
8417507201
commit
4c93668202
12 changed files with 25 additions and 27 deletions
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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
|
|
@ -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)
|
||||
|
|
|
@ -20,4 +20,6 @@ describe BuildCoverageWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'sidekiq_worker'
|
||||
end
|
||||
|
|
|
@ -27,4 +27,6 @@ describe BuildFinishedWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'sidekiq worker'
|
||||
end
|
||||
|
|
|
@ -20,4 +20,6 @@ describe BuildHooksWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'sidekiq worker'
|
||||
end
|
||||
|
|
|
@ -33,4 +33,6 @@ describe BuildSuccessWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'sidekiq worker'
|
||||
end
|
||||
|
|
|
@ -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
|
|
@ -28,4 +28,6 @@ describe ExpireJobCacheWorker do
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
it_behaves_like 'sidekiq worker'
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue