We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 298c80b commit d4d2678Copy full SHA for d4d2678
lib/index.js
@@ -184,12 +184,17 @@ Cluster.prototype.listen = function(createApp, cb) {
184
process.exit(-1);
185
}
186
});
187
- server.listen(port[index], host, function() { //'listening' listener
188
- exitIfBusyPort(host, port, index-1, function(){
189
- server.close();
190
- cb();
191
- })
192
- });
+ if (require('cluster').isMaster) {
+ server.listen(port[index], host, function() { //'listening' listener
+ exitIfBusyPort(host, port, index-1, function(){
+ server.close();
+ cb();
+ })
193
+ });
194
+ }
195
+ else {
196
+ process.nextTick(cb);
197
198
199
200
return self;
0 commit comments