Browse Source

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>
process-exit-stdio-flushing
yorkie 9 years ago
committed by cjihrig
parent
commit
4e905fa8d5
  1. 8
      lib/cluster.js

8
lib/cluster.js

@ -684,10 +684,12 @@ function workerInit() {
Worker.prototype.destroy = function() { Worker.prototype.destroy = function() {
this.exitedAfterDisconnect = true; this.exitedAfterDisconnect = true;
if (!this.isConnected()) process.exit(0); if (!this.isConnected()) {
var exit = process.exit.bind(null, 0); process.exit(0);
} else {
send({ act: 'exitedAfterDisconnect' }, () => process.disconnect()); send({ act: 'exitedAfterDisconnect' }, () => process.disconnect());
process.once('disconnect', exit); process.once('disconnect', () => process.exit(0));
}
}; };
function send(message, cb) { function send(message, cb) {

Loading…
Cancel
Save