mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
b6e22c4bd5
We need to process cluster workers before any preload modules is executed. Otherwise, the child processes are not correctly disovered as clustered workers inside the preloaded modules. Fixes: https://github.com/iojs/io.js/issues/1269 PR-URL: https://github.com/iojs/io.js/pull/1314 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Fedor Indutny <fedor@indutny.com>
8 lines
207 B
JavaScript
8 lines
207 B
JavaScript
var cluster = require('cluster');
|
|
if (cluster.isMaster) {
|
|
cluster.fork(); // one child
|
|
cluster.on('exit', function(worker, code, signal) {
|
|
console.log('worker terminated with code ' + code);
|
|
});
|
|
}
|