diff options
| author | DJ Mountney <dj@gitlab.com> | 2017-03-16 00:44:09 +0000 |
|---|---|---|
| committer | DJ Mountney <dj@gitlab.com> | 2017-03-16 00:44:09 +0000 |
| commit | 111e8684393b0724d6d51d39aea42f1efc37a00c (patch) | |
| tree | c328006cf0b13bbc9b4b573cc3cd13c35f4c4e46 /lib | |
| parent | acb1b3eec1ac1859b08de4ecbed3f494e1ca50e8 (diff) | |
| parent | 353d3da44c912fcd570920c8c465d98885b08b69 (diff) | |
| download | gitlab-ce-111e8684393b0724d6d51d39aea42f1efc37a00c.tar.gz | |
Merge branch 'dm-fix-mailroom-config' into 'master'
Fix reply by email by fixing config/mail_room.yml to be interpretable without ActiveSupport
See merge request !9979
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gitlab/redis.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb index 62dbd429156..bc5370de32a 100644 --- a/lib/gitlab/redis.rb +++ b/lib/gitlab/redis.rb @@ -1,6 +1,7 @@ # This file should not have any direct dependency on Rails environment # please require all dependencies below: require 'active_support/core_ext/hash/keys' +require 'active_support/core_ext/module/delegation' module Gitlab class Redis @@ -9,7 +10,6 @@ module Gitlab SIDEKIQ_NAMESPACE = 'resque:gitlab'.freeze MAILROOM_NAMESPACE = 'mail_room:gitlab'.freeze DEFAULT_REDIS_URL = 'redis://localhost:6379'.freeze - CONFIG_FILE = File.expand_path('../../config/resque.yml', __dir__) class << self delegate :params, :url, to: :new @@ -33,13 +33,17 @@ module Gitlab return @_raw_config if defined?(@_raw_config) begin - @_raw_config = ERB.new(File.read(CONFIG_FILE)).result.freeze + @_raw_config = ERB.new(File.read(config_file)).result.freeze rescue Errno::ENOENT @_raw_config = false end @_raw_config end + + def config_file + ENV['GITLAB_REDIS_CONFIG_FILE'] || File.expand_path('../../config/resque.yml', __dir__) + end end def initialize(rails_env = nil) |
