Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2016-07-12 18:10:03 +0300
committerGabriel Mazetto <gabriel@gitlab.com>2016-08-04 19:55:37 +0300
commit3a93bae25f03a2992401e1de5bfbf52c3921b1a4 (patch)
tree08c2e0190407c708994b56e800425ee6b5006c61 /lib
parent67ae8adc72c1b59c440e0bfbde31df4e0b9920ec (diff)
Few minor fixes to Redis params order and commented out sentinel config
in resque.yml.example Codestyle changes
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/mail_room.rb1
-rw-r--r--lib/gitlab/redis.rb13
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab/mail_room.rb b/lib/gitlab/mail_room.rb
index b49cf1c633b..1f68e09fa2b 100644
--- a/lib/gitlab/mail_room.rb
+++ b/lib/gitlab/mail_room.rb
@@ -4,7 +4,6 @@ require_relative 'redis' unless defined?(Gitlab::Redis)
module Gitlab
module MailRoom
-
class << self
def enabled?
config[:enabled] && config[:address]
diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb
index 70e333eb29f..17ac15a01dd 100644
--- a/lib/gitlab/redis.rb
+++ b/lib/gitlab/redis.rb
@@ -53,18 +53,19 @@ module Gitlab
def redis_store_options
config = raw_config_hash
+ redis_url = config.delete(:url)
+ redis_uri = URI.parse(redis_url)
- redis_uri = URI.parse(config[:url])
if redis_uri.scheme == 'unix'
# Redis::Store does not handle Unix sockets well, so let's do it for them
config[:path] = redis_uri.path
+ config
else
- redis_hash = ::Redis::Store::Factory.extract_host_options_from_uri(config[:url])
- config.merge!(redis_hash)
+ redis_hash = ::Redis::Store::Factory.extract_host_options_from_uri(redis_url)
+ # order is important here, sentinels must be after the connection keys.
+ # {url: ..., port: ..., sentinels: [...]}
+ redis_hash.merge(config)
end
-
- config.delete(:url)
- config
end
def raw_config_hash