vmpooler/vmpooler
Glenn Sarti 9c93d2534f (maint) Fix rubocop offenses
This commit fixes the many rubocop offenses.  Also modifies the rubocop
settings:

- Set max method params higher than the default of 5
- Ignore Style/GuardClause. In some cases it's eaiser to read without the guard
- Renamed a cop
2017-07-18 15:26:27 -07:00

36 lines
729 B
Ruby
Executable file

#!/usr/bin/env ruby
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'rubygems' unless defined?(Gem)
require 'lib/vmpooler'
config = Vmpooler.config
redis_host = config[:redis]['server']
logger_file = config[:config]['logfile']
metrics = Vmpooler.new_metrics(config)
api = Thread.new do
thr = Vmpooler::API.new
thr.helpers.configure(config, Vmpooler.new_redis(redis_host), metrics)
thr.helpers.execute!
end
manager = Thread.new do
Vmpooler::PoolManager.new(
config,
Vmpooler.new_logger(logger_file),
Vmpooler.new_redis(redis_host),
metrics
).execute!
end
if ENV['VMPOOLER_DEBUG']
trap('INT') do
puts 'Shutting down.'
[api, manager].each(&:exit)
end
end
[api, manager].each(&:join)