mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 11:48:26 -06:00
Update mini_profiler.rb
Passing a pre-defined Redis connection to MiniProfiler stops connection leakage. Should limit MiniProfiler connections to one per running process.
This commit is contained in:
parent
204759a3ea
commit
9a1fb90b91
@ -1,8 +1,7 @@
|
|||||||
# If Mini Profiler is included via gem
|
# If Mini Profiler is included via gem
|
||||||
if defined?(Rack::MiniProfiler)
|
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::RedisStore.new(:connection => DiscourseRedis.new)
|
||||||
Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore
|
|
||||||
|
|
||||||
# For our app, let's just show mini profiler always, polling is chatty so nuke that
|
# 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|
|
Rack::MiniProfiler.config.pre_authorize_cb = lambda do |env|
|
||||||
|
Loading…
Reference in New Issue
Block a user