summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGabriel Mazetto <gabriel@gitlab.com>2016-08-06 03:01:52 +0200
committerGabriel Mazetto <gabriel@gitlab.com>2016-08-06 04:15:16 +0200
commited0a7c254ab32130296fb7ee467f655d200d7854 (patch)
tree42714bb5b3fafea87d3b889da94474b788897f26 /lib
parentce41b5c73f7574ec19c47f24e9450ff1b54ef1b1 (diff)
downloadgitlab-ce-ed0a7c254ab32130296fb7ee467f655d200d7854.tar.gz
Small refactor in Redis class and improved specs
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/redis.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/gitlab/redis.rb b/lib/gitlab/redis.rb
index 72fa80e61e2..9376b54f43b 100644
--- a/lib/gitlab/redis.rb
+++ b/lib/gitlab/redis.rb
@@ -19,7 +19,7 @@ module Gitlab
class << self
def params
- PARAMS_MUTEX.synchronize { new.params }
+ @params || PARAMS_MUTEX.synchronize { @params = new.params }
end
# @deprecated Use .params instead to get sentinel support
@@ -35,6 +35,10 @@ module Gitlab
end
@pool.with { |redis| yield redis }
end
+
+ def reset_params!
+ @params = nil
+ end
end
def initialize(rails_env = nil)