Skip to content

Commit

Permalink
#2995 remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Unitech committed Aug 23, 2017
1 parent f8b7bf3 commit f2f16d1
Showing 1 changed file with 3 additions and 42 deletions.
45 changes: 3 additions & 42 deletions lib/God.js
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ God.handleExit = function handleExit(clu, exit_code, kill_signal) {
pidusage.unmonitor(proc.process.pid);

var stopping = (proc.pm2_env.status == cst.STOPPING_STATUS
|| proc.pm2_env.status == cst.STOPPED_STATUS
|| proc.pm2_env.status == cst.STOPPED_STATUS
|| proc.pm2_env.status == cst.ERRORED_STATUS) || (proc.pm2_env.autorestart === false ||
proc.pm2_env.autorestart === "false");

Expand Down Expand Up @@ -446,12 +446,6 @@ God.handleExit = function handleExit(clu, exit_code, kill_signal) {
* Init new process
*/
God.prepare = function prepare(env, cb) {
// var external_lb = false;

// if (env.external_lb)
// external_lb = true;

// Determine number of instances to prepare
if (typeof(env.instances) === 'undefined')
env.instances = 1;

Expand All @@ -471,10 +465,6 @@ God.prepare = function prepare(env, cb) {
God.injectVariables(env, function inject (err, _env) {
if (err) return next(err);

// if (external_lb === true) {
// _env.env.NEW_PORT = PortPool.getAvailablePort();
// }

return God.executeApp(Utility.clone(_env), function (err, clu) {
if (err) return next(err);
God.notify('start', clu, true);
Expand All @@ -483,37 +473,8 @@ God.prepare = function prepare(env, cb) {
return next(null, Utility.clone(clu));
});
});
}, function(err, procs) {
// if (!err && external_lb === true) {
// var ret = procs.map(function(proc) {
// return proc.pm2_env.env.NEW_PORT;
// });

// var listener = function (packet) {
// God.bus.removeListener('prev_listening_port', listener);
// God.clusters_db[procs[0].pm2_env.pm_id].pm2_env.prev_listening_port = packet.data.port;

// var balancer = {
// app_name : procs[0].pm2_env.name,
// routing : {
// mode : 'http',
// in_port : packet.data.port,
// out_ports : ret
// }
// };

// God.spiderlink.call('addOrUpdateAppRouting', balancer, function() {
// return cb(err, procs);
// });
// return false;
// }

// return God.bus.on('prev_listening_port', listener);
// }

return cb(err, procs);
});
};
}, cb);
}

/**
* @method finalizeProcedure
Expand Down

0 comments on commit f2f16d1

Please sign in to comment.