Method: Perus::Server::Server#initialize
- Defined in:
- lib/perus/server/server.rb
#initialize(options_path = DEFAULT_SERVER_OPTIONS_PATH, environment = 'development') ⇒ Server
Returns a new instance of Server.
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/perus/server/server.rb', line 29 def initialize( = DEFAULT_SERVER_OPTIONS_PATH, environment = 'development') self.class.() ENV['RACK_ENV'] = environment # initialise/migrate the db and start cleanup/caching timers DB.start DB.start_timers # ping data is processed in a thread pool Thread.new do while true ping = Server.ping_queue.pop begin ping.call rescue => e puts e.inspect if e.backtrace.is_a?(Array) puts e.backtrace.join("\n") + "\n" end end end end end |