cluster: remove use of bind() in destroy()
This commit replaces process.exit.bind() with an arrow function in Worker.prototype.destroy(). PR-URL: https://github.com/nodejs/node/pull/6502 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
parent
db3db078f3
commit
4e905fa8d5
@ -684,10 +684,12 @@ function workerInit() {
|
||||
|
||||
Worker.prototype.destroy = function() {
|
||||
this.exitedAfterDisconnect = true;
|
||||
if (!this.isConnected()) process.exit(0);
|
||||
var exit = process.exit.bind(null, 0);
|
||||
send({ act: 'exitedAfterDisconnect' }, () => process.disconnect());
|
||||
process.once('disconnect', exit);
|
||||
if (!this.isConnected()) {
|
||||
process.exit(0);
|
||||
} else {
|
||||
send({ act: 'exitedAfterDisconnect' }, () => process.disconnect());
|
||||
process.once('disconnect', () => process.exit(0));
|
||||
}
|
||||
};
|
||||
|
||||
function send(message, cb) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user