19 lines
366 B
Ruby
Executable File
19 lines
366 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
$LOAD_PATH << File.join(Dir.pwd, "lib")
|
|
|
|
require "app"
|
|
require "protocols"
|
|
require "models"
|
|
require "distributor"
|
|
|
|
Signal.trap("SIGINT") do
|
|
Thread.new do
|
|
$logger.info "SIGINT, closing the app peacefully"
|
|
$logger.close
|
|
exit 0
|
|
end.join
|
|
end
|
|
|
|
$logger.info "Starting app"
|
|
Distributor.new.start(cpu_sleep: (ENV["CPU_SLEEP"] || 1).to_i)
|