Matias Alejo Garcia
8 years ago
No known key found for this signature in database
GPG Key ID: 2470DB551277AB3
1 changed files with
7 additions and
7 deletions
-
bws.js
|
@ -91,14 +91,14 @@ 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
|
|
|
|
|
|
cluster.on('exit', function(worker) { |
|
|
|
|
|
// Replace the dead worker,
|
|
|
|
|
|
log.error('Worker ' + worker.id + ' died :('); |
|
|
|
|
|
cluster.fork(); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Listen for dying workers
|
|
|
|
|
|
cluster.on('exit', function(worker) { |
|
|
|
|
|
// Replace the dead worker,
|
|
|
|
|
|
log.error('Worker ' + worker.id + ' died :('); |
|
|
|
|
|
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); |
|
|