Module: Hoss::Rails
Overview
Module for explicitly starting the Hoss agent and hooking into Rails. It is recommended to use the Railtie instead.
Instance Method Summary collapse
-
#start(config) ⇒ true?
Start the Hoss agent and hook into Rails.
Instance Method Details
#start(config) ⇒ true?
Start the Hoss agent and hook into Rails. Note that the agent won’t be started if the Rails console is being used.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/hoss/rails.rb', line 32 def start(config) config = Config.new(config) unless config.is_a?(Config) if (reason = should_skip?(config)) unless config. config.logger.info "Skipping because: #{reason}. " \ "Start manually with `Hoss.start'" end return end Hoss.start(config).tap do |agent| end Hoss.running? rescue StandardError => e if config. config.logger.error format('Failed to start: %s', e.) config.logger.debug "Backtrace:\n" + e.backtrace.join("\n") else puts format('Failed to start: %s', e.) puts "Backtrace:\n" + e.backtrace.join("\n") end end |