Browse files

Fixed stand-alone support with a file path. Closes #141 [reported by …

…SebastianEdwards]
  • Loading branch information...
1 parent 80bcf50 commit 4a9ed216e6d69305f3c50209de81ba3a4e5a88c0 @tj tj committed Aug 15, 2011
Showing with 18 additions and 1 deletion.
  1. +1 −1 lib/worker.js
  2. +1 −0 test/support/standalone.js
  3. +16 −0 test/test.standalone.file.js
View
2 lib/worker.js
@@ -77,7 +77,7 @@ Worker.prototype.start = function(){
this.stdin.resume();
// demote usr/group
- if (this.server) {
+ if (this.server && this.server.listenFD) {
this.server.on('listening', function(){
var group = self.options.group;
if (group) process.setgid(group);
View
1 test/support/standalone.js
@@ -0,0 +1 @@
+
View
16 test/test.standalone.file.js
@@ -0,0 +1,16 @@
+
+/**
+ * Module dependencies.
+ */
+
+var cluster = require('../');
+
+cluster = cluster('./support/standalone')
+ .set('workers', 4)
+ .start();
+
+if (cluster.isMaster) {
+ setTimeout(function(){
+ process.kill(process.pid, 'SIGQUIT');
+ }, 500);
+}

0 comments on commit 4a9ed21

Please sign in to comment.