summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDJ Mountney <dj@gitlab.com>2017-03-16 00:44:09 +0000
committerDJ Mountney <dj@gitlab.com>2017-03-16 00:44:09 +0000
commit111e8684393b0724d6d51d39aea42f1efc37a00c (patch)
treec328006cf0b13bbc9b4b573cc3cd13c35f4c4e46 /lib
parentacb1b3eec1ac1859b08de4ecbed3f494e1ca50e8 (diff)
parent353d3da44c912fcd570920c8c465d98885b08b69 (diff)
downloadgitlab-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.rb8
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)