Fix shards not respawning on exit

This commit is contained in:
Schuyler Cebulskie
2017-11-20 22:37:35 -05:00
parent 527c729aca
commit c6244ee6e1

View File

@@ -78,7 +78,7 @@ class Shard extends EventEmitter {
* @type {Function} * @type {Function}
* @private * @private
*/ */
this._exitListener = this._handleExit.bind(this); this._exitListener = this._handleExit.bind(this, undefined);
} }
/** /**
@@ -282,8 +282,7 @@ 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) { _handleExit(respawn = this.manager.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