stuff
This commit is contained in:
parent
571e81ace5
commit
a7e1478697
@ -40,6 +40,7 @@ var checkDroplet = function(id, time){
|
|||||||
};
|
};
|
||||||
|
|
||||||
var workerCreate = function(count){
|
var workerCreate = function(count){
|
||||||
|
console.log('creating worker. ', count);
|
||||||
doapi.dropletCreate({
|
doapi.dropletCreate({
|
||||||
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().replace('.',''),
|
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().replace('.',''),
|
||||||
image: '17575764'
|
image: '17575764'
|
||||||
@ -53,8 +54,9 @@ var workerCreate = function(count){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
if(count) setTimeout(function(){
|
if(count) setTimeout(function(){
|
||||||
|
console.log('making ', count-1, 'more');
|
||||||
workerCreate(--count);
|
workerCreate(--count);
|
||||||
}, 1000);
|
}, 2000);
|
||||||
};
|
};
|
||||||
|
|
||||||
var workerDestroy = function(worker){
|
var workerDestroy = function(worker){
|
||||||
@ -71,7 +73,7 @@ var checkWorkersBalance = function(){
|
|||||||
|
|
||||||
if(workers.length < 2){
|
if(workers.length < 2){
|
||||||
console.log('less then 2 workers, starting a droplet');
|
console.log('less then 2 workers, starting a droplet');
|
||||||
for(var i=0; i<2; i++) workerCreate();
|
workerCreate(2);
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
if(workers[workers.length-1].usedrunner !== 0){
|
if(workers[workers.length-1].usedrunner !== 0){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user