diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 18:07:39 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-03 18:07:39 +0300 |
commit | 3cda3d43aef1e92e2eedf7383122c6db9c61149f (patch) | |
tree | 1b4dd068a449d050afafa403de54a00a63e9bfc4 /lib/gitlab/redis | |
parent | 83916cf0a2f9254455a08a723961db34f0840df4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/redis')
-rw-r--r-- | lib/gitlab/redis/wrapper.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/gitlab/redis/wrapper.rb b/lib/gitlab/redis/wrapper.rb index e5e1e1d4165..c990655769c 100644 --- a/lib/gitlab/redis/wrapper.rb +++ b/lib/gitlab/redis/wrapper.rb @@ -59,16 +59,11 @@ module Gitlab config_file_path("redis.#{store_name.underscore}.yml"), # The current Redis instance may have been split off from another one - # (e.g. TraceChunks was split off from SharedState). There are - # installations out there where the lowest priority config source - # (resque.yml) contains bogus values. In those cases, config_file_name - # should resolve to the instance we originated from (the - # "config_fallback") rather than resque.yml. + # (e.g. TraceChunks was split off from SharedState). config_fallback&.config_file_name, # Global config sources: - ENV['GITLAB_REDIS_CONFIG_FILE'], - config_file_path('resque.yml') + ENV['GITLAB_REDIS_CONFIG_FILE'] ].compact.first end @@ -199,11 +194,17 @@ module Gitlab def fetch_config redis_yml = read_yaml(self.class.redis_yml_path).fetch(@rails_env, {}) instance_config_yml = read_yaml(self.class.config_file_name)[@rails_env] + resque_yml = read_yaml(self.class.config_file_path('resque.yml'))[@rails_env] [ redis_yml[self.class.store_name.underscore], + # There are installations out there where the lowest priority config source (resque.yml) contains bogus + # values. In those cases, the configuration should be read for the instance we originated from (the + # "config_fallback"), either from its specific config file or from redis.yml, before falling back to + # resque.yml. instance_config_yml, - self.class.config_fallback && redis_yml[self.class.config_fallback.store_name.underscore] + self.class.config_fallback && redis_yml[self.class.config_fallback.store_name.underscore], + resque_yml ].compact.first end |