From a1a85b2c69de9e375d9b5b361aba1e49bf51ab6e Mon Sep 17 00:00:00 2001 From: Thomas Harvey Date: Thu, 12 Oct 2017 00:58:13 -0400 Subject: [PATCH] patch --- routes/worker_collection.js | 6 +++--- testAPI.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/worker_collection.js b/routes/worker_collection.js index 7d424aa..e0b4b5b 100644 --- a/routes/worker_collection.js +++ b/routes/worker_collection.js @@ -105,9 +105,9 @@ var Worker = (function(){ }; proto.startRunners = function(args){ - console.log('Starting runners on', args.worker.name, args.worker.ip); - var worker = this; + + console.log('Starting runners on', worker.name, worker.ip); // dont make runners on out dated workers if(!worker || worker.settings.image > worker.image.id){ console.log(`Blocked outdated worker(${worker.image.id}), current image ${args.settings.image}.`) @@ -354,7 +354,7 @@ var WorkerCollection = (function(){ // if there are workers being created, stop scale up and down check var skipBalance = workers.currentCreating + workers.length >= workers.settings.min - if(skipBalance || workers.currentCreating){ + if(workers.currentCreating && skipBalance){ return console.log(`Killing balance, workers are being created.`); } diff --git a/testAPI.js b/testAPI.js index 91ff8f8..30b62cd 100644 --- a/testAPI.js +++ b/testAPI.js @@ -63,4 +63,4 @@ let __do = function(till){ setTimeout(__do, 1500, --till); }; -__do(500); +__do(1000);