This commit is contained in:
William Mantly 2016-05-31 00:07:48 -04:00
parent d204f29526
commit d90e0aaa25

View File

@ -42,7 +42,7 @@ var workers = (function(){
workers.create = function(){
return doapi.dropletCreate({
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().slice(-3,-0),
name: 'clw'+workerSnapID+'-'+(Math.random()*100).toString().slice(-4),
image: '17575764'
}, function(data){
data = JSON.parse(data);
@ -96,7 +96,7 @@ var workers = (function(){
stopPercent = stopPercent || 80;
ramPercentUsed(worker.ip, function(usedMemPercent){
if(usedMemPercent < stopPercent ){
var name = 'crunner-'+(Math.random()*100).toString().slice(-3,-0);
var name = 'crunner-'+(Math.random()*100).toString().slice(-4);
return lxc.startEphemeral(name, 'crunner0', worker.ip, function(data){
if(!data.ip) return setTimeout(workers.startRunners(worker, newWorker),0);
console.log('started runner on', worker.name)