Auto-expire Redis metadata key via Redis EXPIRE

This commit also removed the unnecessary Vmpooler::Janitor lib
This commit is contained in:
Scott Schneider 2015-04-07 10:26:55 -07:00
parent 2b9f66b8d2
commit f9de28236b
5 changed files with 19 additions and 127 deletions

View file

@ -7,25 +7,23 @@ require 'lib/vmpooler'
config = Vmpooler.config
redis_host = config[:redis]['server']
redis_ttl = config[:redis]['data_ttl']
logger_file = config[:config]['logfile']
graphite = config[:graphite]['server'] ? config[:graphite]['server'] : nil
api = Thread.new {
thr = Vmpooler::API.new
thr.helpers.configure(config, Vmpooler.new_redis(redis_host))
thr.helpers.execute!
}
janitor = Thread.new {
Vmpooler::Janitor.new(Vmpooler.new_logger(logger_file), Vmpooler.new_redis(redis_host), redis_ttl).execute!
}
thr = Vmpooler::API.new
thr.helpers.configure(config, Vmpooler.new_redis(redis_host))
thr.helpers.execute!
}
manager = Thread.new {
Vmpooler::PoolManager.new(config,
config[:pools],
Vmpooler.new_logger(logger_file),
Vmpooler.new_redis(redis_host),
Vmpooler.new_graphite(graphite)).execute!
}
Vmpooler::PoolManager.new(
config,
Vmpooler.new_logger(logger_file),
Vmpooler.new_redis(redis_host),
Vmpooler.new_graphite(graphite)
).execute!
}
[api, janitor, manager].each { |t| t.join }
[api, manager].each { |t| t.join }