stuff
This commit is contained in:
parent
9c69033756
commit
2a21be1825
@ -42,7 +42,7 @@ var workers = (function(){
|
|||||||
|
|
||||||
workers.create = function(){
|
workers.create = function(){
|
||||||
return doapi.dropletCreate({
|
return doapi.dropletCreate({
|
||||||
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().replace('.',''),
|
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().slice(0,4),
|
||||||
image: '17575764'
|
image: '17575764'
|
||||||
}, function(data){
|
}, function(data){
|
||||||
data = JSON.parse(data);
|
data = JSON.parse(data);
|
||||||
@ -96,7 +96,7 @@ var workers = (function(){
|
|||||||
stopPercent = stopPercent || 80;
|
stopPercent = stopPercent || 80;
|
||||||
ramPercentUsed(worker.ip, function(usedMemPercent){
|
ramPercentUsed(worker.ip, function(usedMemPercent){
|
||||||
if(usedMemPercent < stopPercent ){
|
if(usedMemPercent < stopPercent ){
|
||||||
var name = 'crunner-'+(Math.random()*100).toString().replace('.','');
|
var name = 'crunner-'+(Math.random()*100).toString().slice(0,4);
|
||||||
return lxc.startEphemeral(name, 'crunner0', worker.ip, function(data){
|
return lxc.startEphemeral(name, 'crunner0', worker.ip, function(data){
|
||||||
if(!data.ip) return setTimeout(workers.startRunners(worker, newWorker),0);
|
if(!data.ip) return setTimeout(workers.startRunners(worker, newWorker),0);
|
||||||
console.log('started runner on', worker.name)
|
console.log('started runner on', worker.name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user