Merge pull request #340 from mattkirby/pooler_150_1

Simplify declaration of checkoutlock mutex
This commit is contained in:
Kevin Imber 2019-10-23 09:35:55 -07:00 committed by GitHub
commit 6cbc16cd80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -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

View file

@ -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!