blob: 566be3a9f68b37704d5b643bde08659c9c97206c (
plain)
1
2
3
4
5
6
7
8
9
10
|
const chalk = require('chalk');
for (let i = 0; i < __CLUSTER_CPUSCOUNT; i++) {
cluster.fork();
}
cluster.on('exit', (worker, code, signal) => {
console.log(chalk.yellow("warn: ") + `worker #${worker.id} with pid ${worker.process.pid} died with code ${code}, signal ${signal}`);
cluster.fork();
});
|