mirror of
https://github.com/puppetlabs/vmpooler.git
synced 2026-01-26 01:58:41 -05:00
Simplify declaration of checkoutlock mutex
This commit updates the way that checkoutlock is defined so it is not passed through bin/vmpooler. Without this change there's an unnecessary layer the mutex passes through.
This commit is contained in:
parent
30bf2074fe
commit
0e1a6da043
2 changed files with 3 additions and 4 deletions
|
|
@ -24,8 +24,7 @@ if torun.include? 'api'
|
||||||
api = Thread.new do
|
api = Thread.new do
|
||||||
thr = Vmpooler::API.new
|
thr = Vmpooler::API.new
|
||||||
redis = Vmpooler.new_redis(redis_host, redis_port, redis_password)
|
redis = Vmpooler.new_redis(redis_host, redis_port, redis_password)
|
||||||
checkoutlock = Mutex.new
|
thr.helpers.configure(config, redis, metrics)
|
||||||
thr.helpers.configure(config, redis, metrics, checkoutlock)
|
|
||||||
thr.helpers.execute!
|
thr.helpers.execute!
|
||||||
end
|
end
|
||||||
torun_threads << api
|
torun_threads << api
|
||||||
|
|
|
||||||
|
|
@ -36,11 +36,11 @@ module Vmpooler
|
||||||
use Vmpooler::API::Reroute
|
use Vmpooler::API::Reroute
|
||||||
use Vmpooler::API::V1
|
use Vmpooler::API::V1
|
||||||
|
|
||||||
def configure(config, redis, metrics, checkoutlock)
|
def configure(config, redis, metrics)
|
||||||
self.settings.set :config, config
|
self.settings.set :config, config
|
||||||
self.settings.set :redis, redis
|
self.settings.set :redis, redis
|
||||||
self.settings.set :metrics, metrics
|
self.settings.set :metrics, metrics
|
||||||
self.settings.set :checkoutlock, checkoutlock
|
self.settings.set :checkoutlock, Mutex.new
|
||||||
end
|
end
|
||||||
|
|
||||||
def execute!
|
def execute!
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue