diff options
author | Rubén Dávila <ruben@gitlab.com> | 2018-11-20 00:29:19 +0300 |
---|---|---|
committer | Rubén Dávila <ruben@gitlab.com> | 2018-11-20 00:29:19 +0300 |
commit | c02855f464dff8f490684619639f6f0e2ee8ed5e (patch) | |
tree | 39f93a69b07b27ae58d613cc74326297d1308fae /lib/gitlab/sidekiq_config.rb | |
parent | 624ec62238c1d26ef2745c1147edffde67a2b4e6 (diff) |
Backport of gitlab-ee!8470
Diffstat (limited to 'lib/gitlab/sidekiq_config.rb')
-rw-r--r-- | lib/gitlab/sidekiq_config.rb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/gitlab/sidekiq_config.rb b/lib/gitlab/sidekiq_config.rb index 01f60a98ad8..3b8de64913b 100644 --- a/lib/gitlab/sidekiq_config.rb +++ b/lib/gitlab/sidekiq_config.rb @@ -5,11 +5,18 @@ require 'set' module Gitlab module SidekiqConfig + QUEUE_CONFIG_PATHS = %w[app/workers/all_queues.yml ee/app/workers/all_queues.yml].freeze + # This method is called by `bin/sidekiq-cluster` in EE, which runs outside # of bundler/Rails context, so we cannot use any gem or Rails methods. def self.worker_queues(rails_path = Rails.root.to_s) @worker_queues ||= {} - @worker_queues[rails_path] ||= YAML.load_file(File.join(rails_path, 'app/workers/all_queues.yml')) + + @worker_queues[rails_path] ||= QUEUE_CONFIG_PATHS.flat_map do |path| + full_path = File.join(rails_path, path) + + File.exist?(full_path) ? YAML.load_file(full_path) : [] + end end # This method is called by `bin/sidekiq-cluster` in EE, which runs outside |