Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Update redis_store.rb to reuse single connection

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...
commit 0b721d97db729ab659e6d183f0fa14a46c67d377 1 parent 00be389
Michael authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  Ruby/lib/mini_profiler/storage/redis_store.rb
2  Ruby/lib/mini_profiler/storage/redis_store.rb
View
@@ -38,7 +38,7 @@ def get_unviewed_ids(user)
def redis
return @redis_connection if @redis_connection
require 'redis' unless defined? Redis
- Redis.new @args
+ @redis ||= Redis.new @args
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.