Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update redis_store.rb to reuse single connection #136

Closed
wants to merge 1 commit into from

1 participant

@nverba

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. 

@nverba nverba 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. 
0b721d9
@nverba nverba closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 20, 2013
  1. @nverba

    Update redis_store.rb to reuse single connection

    nverba authored
    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. 
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  Ruby/lib/mini_profiler/storage/redis_store.rb
View
2  Ruby/lib/mini_profiler/storage/redis_store.rb
@@ -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
Something went wrong with that request. Please try again.