mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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:
1 parent
08e0884ae0
commit
1330496bbf
1 file changed
+6
-4
+6
-4
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user