From d62cdd5127bde78ba4b5c1f5e50ab05dc8ccd519 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 3 Dec 2014 15:46:52 -0500 Subject: [PATCH] added support for specifying which ports to use if no port is specified in config.json port from url will be used if no port in url then default to 4567 port in config.json can be an array or a single port number --- loader.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/loader.js b/loader.js index 20566625e2..4ce2d84604 100644 --- a/loader.js +++ b/loader.js @@ -1,7 +1,6 @@ 'use strict'; var nconf = require('nconf'), - net = require('net'), fs = require('fs'), url = require('url'), path = require('path'), @@ -16,7 +15,6 @@ var nconf = require('nconf'), output = logrotate({ file: __dirname + '/logs/output.log', size: '1m', keep: 3, compress: true }), silent = process.env.NODE_ENV !== 'development', numProcs, - workers = [], Loader = { @@ -153,6 +151,7 @@ Loader.addWorkerEvents = function(worker) { }; Loader.start = function(callback) { + numProcs = getPorts().length; console.log('Clustering enabled: Spinning up ' + numProcs + ' process(es).\n'); for (var x=0; x