diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-03-15 16:21:45 -0600 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-03-15 16:21:45 -0600 |
commit | 4eb24c316167eb16a48c7a518699afad1c06d05d (patch) | |
tree | d9b938ec71a1cfecf76c3598854bae64cea26c15 /lib | |
parent | b716680692b4d5f7565e29e8fbd1737d24cbf658 (diff) | |
download | gitlab-ce-4eb24c316167eb16a48c7a518699afad1c06d05d.tar.gz |
Verify config/mail_room.yml is interpretable Ruby
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/redis.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb index 62dbd429156..8af4fd33ff9 100644 --- a/lib/gitlab/redis.rb +++ b/lib/gitlab/redis.rb @@ -9,7 +9,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 +32,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) |