Commit 8810c5d3 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu

Merge branch 'bvl-reorder-sidekiq-client-middleware' into 'master'

Reorder Sidekiq client middleware

See merge request gitlab-org/gitlab!28814
parents 55dee38f a37544ab
...@@ -29,12 +29,12 @@ module Gitlab ...@@ -29,12 +29,12 @@ module Gitlab
# eg: `config.client_middleware(&Gitlab::SidekiqMiddleware.client_configurator)` # eg: `config.client_middleware(&Gitlab::SidekiqMiddleware.client_configurator)`
def self.client_configurator def self.client_configurator
lambda do |chain| lambda do |chain|
chain.add ::Gitlab::SidekiqStatus::ClientMiddleware
chain.add ::Gitlab::SidekiqMiddleware::ClientMetrics
chain.add ::Gitlab::SidekiqMiddleware::WorkerContext::Client # needs to be before the Labkit middleware chain.add ::Gitlab::SidekiqMiddleware::WorkerContext::Client # needs to be before the Labkit middleware
chain.add ::Labkit::Middleware::Sidekiq::Client chain.add ::Labkit::Middleware::Sidekiq::Client
chain.add ::Gitlab::SidekiqMiddleware::AdminMode::Client
chain.add ::Gitlab::SidekiqMiddleware::DuplicateJobs::Client chain.add ::Gitlab::SidekiqMiddleware::DuplicateJobs::Client
chain.add ::Gitlab::SidekiqStatus::ClientMiddleware
chain.add ::Gitlab::SidekiqMiddleware::AdminMode::Client
chain.add ::Gitlab::SidekiqMiddleware::ClientMetrics
end end
end end
end end
......
...@@ -134,12 +134,12 @@ describe Gitlab::SidekiqMiddleware do ...@@ -134,12 +134,12 @@ describe Gitlab::SidekiqMiddleware do
let(:middleware_expected_args) { [worker_class_arg, job, queue, redis_pool] } let(:middleware_expected_args) { [worker_class_arg, job, queue, redis_pool] }
let(:expected_middlewares) do let(:expected_middlewares) do
[ [
Gitlab::SidekiqStatus::ClientMiddleware, ::Gitlab::SidekiqMiddleware::WorkerContext::Client,
Gitlab::SidekiqMiddleware::ClientMetrics, ::Labkit::Middleware::Sidekiq::Client,
Gitlab::SidekiqMiddleware::WorkerContext::Client, ::Gitlab::SidekiqMiddleware::DuplicateJobs::Client,
Labkit::Middleware::Sidekiq::Client, ::Gitlab::SidekiqStatus::ClientMiddleware,
Gitlab::SidekiqMiddleware::AdminMode::Client, ::Gitlab::SidekiqMiddleware::AdminMode::Client,
Gitlab::SidekiqMiddleware::DuplicateJobs::Client ::Gitlab::SidekiqMiddleware::ClientMetrics
] ]
end 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