From 57cfc24e926aaa89d425f558387dd9d71824553c Mon Sep 17 00:00:00 2001 From: william Date: Fri, 22 Apr 2016 12:21:03 -0400 Subject: [PATCH] crunner --- routes/api.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/routes/api.js b/routes/api.js index fd54287..6887d20 100644 --- a/routes/api.js +++ b/routes/api.js @@ -15,7 +15,7 @@ var ip2name = {}; var lxcTimeout = function(ip, time){ var name = ip2name[ip]; console.log(name) - time = time || 100000; + time = time || 900000; // 15 minutes var keys = Object.keys(timeoutEvents) if(keys.indexOf(name) !== -1){ clearTimeout(timeoutEvents[name]) @@ -28,7 +28,7 @@ var lxcTimeout = function(ip, time){ var runner = function(req, res, ip){ - lxcTimeout(ip, 30000); + lxcTimeout(ip); return request.post({url:'http://'+ip, form: req.body}, function(error, response, body){ body = JSON.parse(body); body['ip'] = ip.replace('10.0.', ''); @@ -131,8 +131,8 @@ router.post('/run/:ip?', function doRun(req, res, next){ if(found){ return runner(req, res, ip) }else{ - var name = 'u1-'+(Math.random()*100).toString().replace('.',''); - return lxc.startEphemeral(name, 'u1', function(data){ + var name = 'crunner-'+(Math.random()*100).toString().replace('.',''); + return lxc.startEphemeral(name, 'crunner', function(data){ ip2name[data.ip] = name; return runner(req, res, data.ip); });