This commit is contained in:
William Mantly 2016-05-29 00:52:26 -04:00
parent 571e81ace5
commit a7e1478697

View File

@ -40,6 +40,7 @@ var checkDroplet = function(id, time){
};
var workerCreate = function(count){
console.log('creating worker. ', count);
doapi.dropletCreate({
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().replace('.',''),
image: '17575764'
@ -53,8 +54,9 @@ var workerCreate = function(count){
});
});
if(count) setTimeout(function(){
console.log('making ', count-1, 'more');
workerCreate(--count);
}, 1000);
}, 2000);
};
var workerDestroy = function(worker){
@ -71,7 +73,7 @@ var checkWorkersBalance = function(){
if(workers.length < 2){
console.log('less then 2 workers, starting a droplet');
for(var i=0; i<2; i++) workerCreate();
workerCreate(2);
return ;
}
if(workers[workers.length-1].usedrunner !== 0){