Skip to content

Commit

Permalink
Update redis_store.rb to reuse single connection
Browse files Browse the repository at this point in the history
Each time the redis method got hit, it would spawn a new redis connection. This simple fix reuses a single connection per process. Should stop connection leaks and redundant connections to the redis provider. 
  • Loading branch information
nverba committed Mar 20, 2013
1 parent 00be389 commit 0b721d9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Ruby/lib/mini_profiler/storage/redis_store.rb
Expand Up @@ -38,7 +38,7 @@ def get_unviewed_ids(user)
def redis def redis
return @redis_connection if @redis_connection return @redis_connection if @redis_connection
require 'redis' unless defined? Redis require 'redis' unless defined? Redis
Redis.new @args @redis ||= Redis.new @args
end end


end end
Expand Down

0 comments on commit 0b721d9

Please sign in to comment.