diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2016-10-25 15:50:41 +0200 |
---|---|---|
committer | Gabriel Mazetto <gabriel@gitlab.com> | 2016-10-26 05:02:47 +0200 |
commit | f9126fbe0a73aa6d8d61be2eb249260fa29ac461 (patch) | |
tree | 933146f3919db0197dc3e1b8103930fd0f585816 /lib | |
parent | ea8aa34b55f9029a823c6210258f8552fcaababe (diff) | |
download | gitlab-ce-f9126fbe0a73aa6d8d61be2eb249260fa29ac461.tar.gz |
Updated mail_room and added sentinel support to Reply by Email21645-mail_room_sentinel
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/mail_room.rb | 7 | ||||
-rw-r--r-- | lib/gitlab/redis.rb | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/gitlab/mail_room.rb b/lib/gitlab/mail_room.rb index 12999a90a29..a5220d92312 100644 --- a/lib/gitlab/mail_room.rb +++ b/lib/gitlab/mail_room.rb @@ -33,7 +33,12 @@ module Gitlab config[:mailbox] = 'inbox' if config[:mailbox].nil? if config[:enabled] && config[:address] - config[:redis_url] = Gitlab::Redis.new(rails_env).url + gitlab_redis = Gitlab::Redis.new(rails_env) + config[:redis_url] = gitlab_redis.url + + if gitlab_redis.sentinels? + config[:sentinels] = gitlab_redis.sentinels + end end config diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb index c649da8c426..9226da2d6b1 100644 --- a/lib/gitlab/redis.rb +++ b/lib/gitlab/redis.rb @@ -63,6 +63,14 @@ module Gitlab raw_config_hash[:url] end + def sentinels + raw_config_hash[:sentinels] + end + + def sentinels? + sentinels && !sentinels.empty? + end + private def redis_store_options |