From 9a1fb90b912eebbbca9f3d317ef53f8ba45b35e8 Mon Sep 17 00:00:00 2001 From: nverba Date: Wed, 20 Mar 2013 03:29:07 +0000 Subject: [PATCH] Update mini_profiler.rb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Passing a pre-defined Redis connection to MiniProfiler stops connection leakage. Should limit MiniProfiler connections to one per running process.  --- config/initializers/mini_profiler.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/initializers/mini_profiler.rb b/config/initializers/mini_profiler.rb index 575b31286d5fba..5e17133c2e7651 100644 --- a/config/initializers/mini_profiler.rb +++ b/config/initializers/mini_profiler.rb @@ -1,8 +1,7 @@ # If Mini Profiler is included via gem if defined?(Rack::MiniProfiler) - Rack::MiniProfiler.config.storage_options = YAML.load(ERB.new(File.new("#{Rails.root}/config/redis.yml").read).result)[Rails.env].symbolize_keys - Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore + Rack::MiniProfiler::RedisStore.new(:connection => DiscourseRedis.new) # For our app, let's just show mini profiler always, polling is chatty so nuke that Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|