summaryrefslogtreecommitdiff
path: root/lib/gitlab/sidekiq_config/cli_methods.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-01-28 15:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-01-28 15:08:36 +0000
commitfedf978f9aa1909ed7bb3fad767ad120a1c6bd7b (patch)
tree1bd0f0b301ad96feda1910abe34eb89c46cc55cd /lib/gitlab/sidekiq_config/cli_methods.rb
parentdb24ab2b72dbff24c201410a0561e929ae7e8061 (diff)
downloadgitlab-ce-fedf978f9aa1909ed7bb3fad767ad120a1c6bd7b.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/sidekiq_config/cli_methods.rb')
-rw-r--r--lib/gitlab/sidekiq_config/cli_methods.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/gitlab/sidekiq_config/cli_methods.rb b/lib/gitlab/sidekiq_config/cli_methods.rb
index 1ce46289e81..0676e9df9c5 100644
--- a/lib/gitlab/sidekiq_config/cli_methods.rb
+++ b/lib/gitlab/sidekiq_config/cli_methods.rb
@@ -23,8 +23,10 @@ module Gitlab
@worker_queues[rails_path] ||= QUEUE_CONFIG_PATHS.flat_map do |path|
full_path = File.join(rails_path, path)
+ queues = File.exist?(full_path) ? YAML.load_file(full_path) : []
- File.exist?(full_path) ? YAML.load_file(full_path) : []
+ # https://gitlab.com/gitlab-org/gitlab/issues/199230
+ queues.map { |queue| queue.is_a?(Hash) ? queue[:name] : queue }
end
end
@@ -37,6 +39,12 @@ module Gitlab
[queue, *queues_set.grep(/\A#{queue}:/)]
end
end
+
+ def clear_memoization!
+ if instance_variable_defined?('@worker_queues')
+ remove_instance_variable('@worker_queues')
+ end
+ end
# rubocop:enable Gitlab/ModuleWithInstanceVariables
end
end