Skip to content

Commit

Permalink
Use single block of initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
robertomiranda committed Sep 10, 2024
1 parent 6b1ddff commit 4999cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/promenade/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class Configuration
def initialize
@rack_latency_buckets = DEFAULT_RACK_LATENCY_BUCKETS
@queue_time_buckets = DEFAULT_QUEUE_TIME_BUCKETS
@pitchfork_stats_enabled = false
end
end
end
8 changes: 2 additions & 6 deletions lib/promenade/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ class Railtie < ::Rails::Railtie
Promenade::Client::Rack::HTTPRequestDurationCollector
Rails.application.config.middleware.insert 0,
Promenade::Client::Rack::HTTPRequestQueueTimeCollector
end

initializer "promenade.configure_middlewares", after: :load_config_initializers do
pitchfork_stats_enabled = false

if pitchfork_stats_enabled && defined?(::Raindrops)
if defined?(::Raindrops)
require "promenade/raindrops/middleware"
Rails.application.config.middleware.use Promenade::Raindrops::Middleware
end

if pitchfork_stats_enabled && defined?(::Pitchfork)
if defined?(::Pitchfork)
require "promenade/pitchfork/middleware"
Rails.application.config.middleware.use Promenade::Pitchfork::Middleware
end
Expand Down

0 comments on commit 4999cbf

Please sign in to comment.