diff --git a/lib/racecar/ctl.rb b/lib/racecar/ctl.rb index fdb07c28..a45393b1 100644 --- a/lib/racecar/ctl.rb +++ b/lib/racecar/ctl.rb @@ -36,8 +36,10 @@ def liveness_probe(args) require "racecar/liveness_probe" parse_options!(args) - if ENV["RAILS_ENV"] - Racecar.config.load_file("config/racecar.yml", ENV["RAILS_ENV"]) + RailsConfigFileLoader.load! unless config.without_rails? + + if File.exist?("config/racecar.rb") + require "./config/racecar" end Racecar.config.liveness_probe.check_liveness_within_interval! @@ -136,5 +138,9 @@ def parse_options!(args) parser.parse!(args) end + + def config + Racecar.config + end end end