Permalink
Browse files

add option to start listener on app

  • Loading branch information...
1 parent 07426fc commit fb08c538c02e8a532f1aa9caae508436e3d152a9 @snodgrass23 committed Mar 29, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/balance.js
View
@@ -1,7 +1,9 @@
var cluster = require('cluster');
var os = require('os');
-module.exports = function(app_path, max) {
+module.exports = function(app_path, max, start) {
+
+ start = ('undefined' == typeof start) ? true : start;
// Figure out how many workers to start
var num_workers = parseInt(max, 10) || os.cpus().length;
@@ -28,6 +30,6 @@ module.exports = function(app_path, max) {
}
else {
var app = require(app_path);
- app.start();
+ if (start) app.start();
}
};

0 comments on commit fb08c53

Please sign in to comment.