diff options
author | Gabriel Mazetto <gabriel@gitlab.com> | 2016-08-06 03:01:52 +0200 |
---|---|---|
committer | Gabriel Mazetto <gabriel@gitlab.com> | 2016-08-06 04:15:16 +0200 |
commit | ed0a7c254ab32130296fb7ee467f655d200d7854 (patch) | |
tree | 42714bb5b3fafea87d3b889da94474b788897f26 /lib | |
parent | ce41b5c73f7574ec19c47f24e9450ff1b54ef1b1 (diff) | |
download | gitlab-ce-ed0a7c254ab32130296fb7ee467f655d200d7854.tar.gz |
Small refactor in Redis class and improved specs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/redis.rb | 6 |
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) |