lib/sensu-dashboard/app.rb in sensu-dashboard-0.9.8.beta vs lib/sensu-dashboard/app.rb in sensu-dashboard-0.9.8.beta.1

- old
+ new

@@ -1,31 +1,34 @@ require 'sensu/base' +require 'thin' +require 'sinatra/async' require 'em-http-request' require 'em-websocket' -require 'sinatra/async' require 'sass' class Dashboard < Sinatra::Base register Sinatra::Async def self.run(options={}) EM::run do self.setup(options) self.websocket_server - self.run!(:port => $settings[:dashboard][:port]) + Thin::Logging.silent = true + Thin::Server.start(self, $settings[:dashboard][:port]) + %w[INT TERM].each do |signal| Signal.trap(signal) do self.stop(signal) end end end end def self.setup(options={}) + $logger = Cabin::Channel.get base = Sensu::Base.new(options) $settings = base.settings - $logger = base.logger unless $settings[:dashboard].is_a?(Hash) raise('missing dashboard configuration') end unless $settings[:dashboard][:port].is_a?(Integer) raise('dashboard must have a port')