Commit b91df19b authored by priit's avatar priit
Browse files

Taaskäivita instans

parent 3b016832
......@@ -54,8 +54,16 @@ function startCluster( instanceCount, cb ){
cluster.fork();
}
cluster.on('exit', function(worker, code, signal) {
log4jsLogger.error('worker ' + worker.process.pid + ' died; Code: ' + code + '; Signal: ' + signal);
cluster.on('exit', function(deadWorker, code, signal) {
// Restart the worker
var worker = cluster.fork();
// Note the process IDs
var newPID = worker.process.pid;
var oldPID = deadWorker.process.pid;
// Log the event
log4jsLogger.error('worker ' + oldPID + ' died; Code: ' + code + '; Signal: ' + signal);
log4jsLogger.error('worker ' + newPID + ' born.');
});
cleanerService.init();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment