Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Disable cluster by default

  • Loading branch information...
commit ab654737b8931749d423ee979edaabc778e66028 1 parent b82cdcd
@camshaft authored
Showing with 6 additions and 5 deletions.
  1. +2 −1  bin/startup
  2. +3 −3 lib/commands/start.js
  3. +1 −1  package.json
View
3  bin/startup
@@ -31,8 +31,9 @@ else {
startup
.command("start")
.description("start app server")
+ .option('-C, --cluster', 'run a cluster', false)
.action(function() {
- require("../lib/commands/start")(path, startup.dev);
+ require("../lib/commands/start")(path, startup.dev, startup.cluster);
});
startup
View
6 lib/commands/start.js
@@ -4,7 +4,7 @@ var child_process = require('child_process')
, runner = require('../runner')
, wrapper = join(__dirname,"/../wrapper");
-module.exports = function(path, dev) {
+module.exports = function(path, dev, clust) {
if (process.env.NODE_ENV=="development" || dev) {
@@ -32,7 +32,7 @@ module.exports = function(path, dev) {
});
}
else {
- try {
+ if (clust) {
var cluster = require("cluster")
, numCPUs = require('os').cpus().length;
@@ -58,7 +58,7 @@ module.exports = function(path, dev) {
process.on("SIGTERM", handleSignal("SIGTERM"));
process.on("SIGINT", handleSignal("SIGINT"));
}
- catch (e) {
+ else {
var server = runner(path);
require("../sigterm")(server);
}
View
2  package.json
@@ -1,6 +1,6 @@
{
"name": "startup",
- "version": "0.0.13",
+ "version": "0.0.14",
"description": "Node.js HTTP app runner",
"scripts": {
"test": "./node_modules/.bin/mocha"
Please sign in to comment.
Something went wrong with that request. Please try again.