This commit is contained in:
William Mantly 2016-05-27 10:45:42 -04:00
parent ac524a1c76
commit ee3091ae3c

View File

@ -55,11 +55,11 @@ var checkWorkersBalance = function(){
if(!workers){ if(!workers){
return workerCreate(); return workerCreate();
} }
if(!workers[workers.length-1].availrunners.length){ if(workers[workers.length-1].availrunners.length === 0){
console.log('starting new droplet!'); console.log('starting new droplet!');
return workerCreate(); return workerCreate();
} }
if(!workers[workers.length-1].availrunners.length && !workers[workers.length-2].availrunners.length){ if(workers[workers.length-1].usedrunner === 0 && workers[workers.length-2].usedrunner === 0){
workerDestroy(); workerDestroy();
} }