fix dying workers handle
This commit is contained in:
parent
4a2b92bcb0
commit
210b73d198
2
bws.js
2
bws.js
|
@ -91,6 +91,7 @@ if (config.cluster) {
|
||||||
// Create a worker for each CPU
|
// Create a worker for each CPU
|
||||||
for (var i = 0; i < instances; i += 1) {
|
for (var i = 0; i < instances; i += 1) {
|
||||||
cluster.fork();
|
cluster.fork();
|
||||||
|
}
|
||||||
|
|
||||||
// Listen for dying workers
|
// Listen for dying workers
|
||||||
cluster.on('exit', function(worker) {
|
cluster.on('exit', function(worker) {
|
||||||
|
@ -98,7 +99,6 @@ if (config.cluster) {
|
||||||
log.error('Worker ' + worker.id + ' died :(');
|
log.error('Worker ' + worker.id + ' died :(');
|
||||||
cluster.fork();
|
cluster.fork();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
// Code to run if we're in a worker process
|
// Code to run if we're in a worker process
|
||||||
} else {
|
} else {
|
||||||
startInstance(logStart);
|
startInstance(logStart);
|
||||||
|
|
Loading…
Reference in New Issue