mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 19:13:31 +01:00
Possibly fix weird behaviour
This commit is contained in:
@@ -282,17 +282,20 @@ class Shard extends EventEmitter {
|
|||||||
* @param {boolean} [respawn=this.manager.respawn] Whether to spawn the shard again
|
* @param {boolean} [respawn=this.manager.respawn] Whether to spawn the shard again
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_handleExit(respawn = this.manager.respawn) {
|
_handleExit(respawn) {
|
||||||
|
if (typeof respawn === 'undefined') respawn = this.manager.respawn;
|
||||||
/**
|
/**
|
||||||
* Emitted upon the shard's child process exiting.
|
* Emitted upon the shard's child process exiting.
|
||||||
* @event Shard#death
|
* @event Shard#death
|
||||||
* @param {ChildProcess} process Child process that exited
|
* @param {ChildProcess} process Child process that exited
|
||||||
*/
|
*/
|
||||||
this.emit('death', this.process);
|
this.emit('death', this.process);
|
||||||
|
|
||||||
this.ready = false;
|
this.ready = false;
|
||||||
this.process = null;
|
this.process = null;
|
||||||
this._evals.clear();
|
this._evals.clear();
|
||||||
this._fetches.clear();
|
this._fetches.clear();
|
||||||
|
|
||||||
if (respawn) this.spawn().catch(err => this.emit('error', err));
|
if (respawn) this.spawn().catch(err => this.emit('error', err));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user