bugfix
This commit is contained in:
parent
3985571a96
commit
c271c05b0d
@ -38,7 +38,7 @@ class Shard extends EventEmitter {
|
|||||||
|
|
||||||
this.process = ChildProcess.fork(this.filePath, this.args, { env: { ...this.env, SHARD_ID: this.id }, execArgv: this.execArgv })
|
this.process = ChildProcess.fork(this.filePath, this.args, { env: { ...this.env, SHARD_ID: this.id }, execArgv: this.execArgv })
|
||||||
.on('message', this._handleMessage.bind(this))
|
.on('message', this._handleMessage.bind(this))
|
||||||
.on('exit', this._handleExit().bind(this))
|
.on('exit', this._handleExit.bind(this))
|
||||||
.on('disconnect', this._handleDisconnect.bind(this)); // Don't know if this is going to help, but monitoring whether this gets called whenever a process on its own closes the IPC channel
|
.on('disconnect', this._handleDisconnect.bind(this)); // Don't know if this is going to help, but monitoring whether this gets called whenever a process on its own closes the IPC channel
|
||||||
|
|
||||||
this.process.once('spawn', () => {
|
this.process.once('spawn', () => {
|
||||||
@ -136,7 +136,7 @@ class Shard extends EventEmitter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_handleExit (code, signal, respawn = this._respawn) {
|
_handleExit (code, signal, respawn = this._respawn) {
|
||||||
this.process.removeAllListeners();
|
if (this.process) this.process.removeAllListeners();
|
||||||
this.emit('death');
|
this.emit('death');
|
||||||
|
|
||||||
if (code !== 0) this.crashes.push(Date.now() - this.spawnedAt);
|
if (code !== 0) this.crashes.push(Date.now() - this.spawnedAt);
|
||||||
|
Loading…
Reference in New Issue
Block a user