diff options
author | Robert Speicher <rspeicher@gmail.com> | 2018-11-26 17:55:21 +0000 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2018-11-26 17:55:21 +0000 |
commit | 4ec90095028b7519f64d209a9358831508dbf77f (patch) | |
tree | d844e9756c67d87839c699817a184782fce22a4f /lib | |
parent | 890addcbf3362ffada5fc61daa28b40f06d3812c (diff) | |
parent | c02855f464dff8f490684619639f6f0e2ee8ed5e (diff) | |
download | gitlab-ce-4ec90095028b7519f64d209a9358831508dbf77f.tar.gz |
Merge branch 'ce-rd-extract-ee-specific-sidekiq-queue-config' into 'master'
Backport of gitlab-ee!8470
See merge request gitlab-org/gitlab-ce!23150
Diffstat (limited to 'lib')
-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 |