diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /lib/gitlab/sidekiq_config.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'lib/gitlab/sidekiq_config.rb')
-rw-r--r-- | lib/gitlab/sidekiq_config.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/sidekiq_config.rb b/lib/gitlab/sidekiq_config.rb index 3eef41a2ca2..ac9a7d25fc2 100644 --- a/lib/gitlab/sidekiq_config.rb +++ b/lib/gitlab/sidekiq_config.rb @@ -141,6 +141,20 @@ module Gitlab .to_h end + # Get the list of queues from all available workers following queue + # routing rules. Sidekiq::Queue.all fetches the list of queues from Redis. + # It may contain some redundant, obsolete queues from previous iterations + # of GitLab. + def routing_queues + @routing_queues ||= workers.map do |worker| + if worker.klass.is_a?(Gitlab::SidekiqConfig::DummyWorker) + worker.queue + else + ::Gitlab::SidekiqConfig::WorkerRouter.global.route(worker.klass) + end + end.uniq.sort + end + private def find_workers(root, ee:, jh:) |