moved handle close to fork worker

v1.18.x
barisusakli 10 years ago
parent 5521e6143f
commit 785790c414

@ -141,15 +141,6 @@ Loader.addClusterEvents = function(callback) {
case 'config:update':
Loader.notifyWorkers(message);
break;
case 'sticky-session:accept':
var _handle = handles[message.handleIndex];
if (_handle) {
_handle.close();
delete handles[message.handleIndex];
}
break;
}
}
});
@ -229,6 +220,19 @@ function forkWorker(isPrimary) {
worker.process.stdout.pipe(output);
worker.process.stderr.pipe(output);
}
worker.on('message', function(message) {
if (!message || message.action !== 'sticky-session:accept') {
return;
}
var _handle = handles[message.handleIndex];
if (_handle) {
_handle.close();
delete handles[message.handleIndex];
}
});
}
function workerIndex(ip, numProcs) {

@ -151,8 +151,8 @@ if(nconf.get('ssl')) {
return;
}
server.emit('connection', connection);
process.send({action: 'sticky-session:accept', handleIndex: message.handleIndex});
server.emit('connection', connection);
});
}(WebServer));

Loading…
Cancel
Save