diff --git a/routes/api.js b/routes/api.js index 7c72615..9dca5ae 100644 --- a/routes/api.js +++ b/routes/api.js @@ -49,13 +49,13 @@ var checkWorkersBalance = function(){ if(isCheckingWorkers) return false; isCheckingWorkers = true; - if(!workers ){ + if(!workers){ return workerCreate(); } - if(workers[workers.length-1].usedrunner){ + if(!workers[workers.length-1].availrunners.length){ return workerCreate(); } - if(workers[workers.length-1].usedrunner && workers[workers.length-2].usedrunner){ + if(!workers[workers.length-1].availrunners.length && !workers[workers.length-2].availrunners.length){ workerDestroy(); }