闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
542 B

  1. require 'rack-mini-profiler'
  2. Rack::MiniProfilerRails.initialize!(Rails.application)
  3. Rails.application.middleware.swap(Rack::Deflater, Rack::MiniProfiler)
  4. Rails.application.middleware.swap(Rack::MiniProfiler, Rack::Deflater)
  5. Rack::MiniProfiler.config.storage = Rack::MiniProfiler::MemoryStore
  6. if Rails.env.production?
  7. Rack::MiniProfiler.config.storage_options = {
  8. host: ENV.fetch('REDIS_HOST') { 'localhost' },
  9. port: ENV.fetch('REDIS_PORT') { 6379 },
  10. }
  11. Rack::MiniProfiler.config.storage = Rack::MiniProfiler::RedisStore
  12. end