workers: do not listen for close event.

This commit is contained in:
Christopher Jeffrey 2017-08-11 15:21:16 -07:00
parent b8f57df90c
commit 28d2f1478e
No known key found for this signature in database
GPG Key ID: 8962AB9DE6666BBD

View File

@ -65,16 +65,11 @@ Child.prototype.init = function init(file) {
this.emit('error', err);
});
this.child.on('exit', (code, signal) => {
this.child.once('exit', (code, signal) => {
children.delete(this);
this.emit('exit', code == null ? -1 : code, signal);
});
this.child.on('close', () => {
children.delete(this);
this.emit('exit', -1, null);
});
this.child.stdin.on('error', (err) => {
this.emit('error', err);
});