diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-18 02:47:47 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-11-18 02:47:47 +0300 |
commit | 4f1a71c63c2fb91c40a069f21521bb1e180c0594 (patch) | |
tree | b7c55719ae017467d8fd52087a577b6e9d77471d | |
parent | b562a203320f7ea9e13917bf49fa8066c0aca6d4 (diff) |
Add latest changes from gitlab-org/gitlab@16-6-stable-ee
-rw-r--r-- | lib/gitlab/redis/wrapper.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/gitlab/redis/wrapper.rb b/lib/gitlab/redis/wrapper.rb index d5470bc0016..c1f346ec7e4 100644 --- a/lib/gitlab/redis/wrapper.rb +++ b/lib/gitlab/redis/wrapper.rb @@ -111,6 +111,8 @@ module Gitlab end def secret_file + return unless defined?(Settings) + if raw_config_hash[:secret_file].blank? File.join(Settings.encrypted_settings['path'], 'redis.yaml.enc') else @@ -132,9 +134,11 @@ module Gitlab # the file. In other cases, like when being loaded as part of spinning # up test environment via `scripts/setup-test-env`, we should gate on # the presence of the specified secret file so that - # `Settings.encrypted`, which might not be loadable does not gets - # called. - Settings.encrypted(secret_file) if File.exist?(secret_file) || ::Gitlab::Runtime.rake? + # `Settings.encrypted`, which might not be loadable does not get + # called. Same is the case when this library gets called by Mailroom + # which does not have rails environment available. + Settings.encrypted(secret_file) if (secret_file && File.exist?(secret_file)) || + (defined?(Gitlab::Runtime) && Gitlab::Runtime.rake?) end private |