First attempt at adding connection pool to pool manager

This commit is contained in:
kirby@puppetlabs.com 2020-04-22 21:25:01 -07:00
parent 70f0482d33
commit 52bf6c4c89
5 changed files with 498 additions and 413 deletions

View file

@ -110,7 +110,7 @@ module Vmpooler
# Create an index of pool aliases
parsed_config[:pool_names] = Set.new
unless parsed_config[:pools]
redis = new_redis(parsed_config[:redis]['server'], parsed_config[:redis]['port'], parsed_config[:redis]['password'])
redis = redis_connection(parsed_config[:redis]['server'], parsed_config[:redis]['port'], parsed_config[:redis]['password'])
parsed_config[:pools] = load_pools_from_redis(redis)
end
@ -156,7 +156,7 @@ module Vmpooler
pools
end
def self.new_redis(host = 'localhost', port = nil, password = nil)
def self.redis_connection(host = 'localhost', port = nil, password = nil)
Redis.new(host: host, port: port, password: password)
end