Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update mini_profiler.rb

Passing a pre-defined Redis connection to MiniProfiler stops connection leakage. Should limit MiniProfiler connections to one per running process. 
  • Loading branch information...
commit 9a1fb90b912eebbbca9f3d317ef53f8ba45b35e8 1 parent 204759a
@nverba authored
Showing with 1 addition and 2 deletions.
  1. +1 −2  config/initializers/mini_profiler.rb
View
3  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|
Please sign in to comment.
Something went wrong with that request. Please try again.