use cluster module to handle auto restart on death

having some problems with docker auto restarts so we will do it in the
code for now
This commit is contained in:
Roman Shtylman
2015-01-10 21:02:45 -08:00
parent 7f6640a9d6
commit 8d78956355

View File

@@ -1,10 +1,22 @@
#!/usr/bin/env node
var cluster = require('cluster');
var debug = require('debug')('localtunnel');
var localenv = require('localenv');
if (cluster.isMaster) {
cluster.on('exit', function() {
debug('child died, restarting');
cluster.fork();
});
cluster.fork();
return;
}
require('stackup');
var log = require('bookrc');
var localenv = require('localenv');
var optimist = require('optimist');
var debug = require('debug')('localtunnel');
var argv = optimist
.usage('Usage: $0 --port [num]')