fix: destroy options during cleanup

v13.8.1
This commit is contained in:
March 7th 2022-06-17 12:48:31 +07:00
parent 8b98630169
commit 206c699844

View File

@ -367,7 +367,7 @@ class WebSocketShard extends EventEmitter {
if (this.connection) {
this._cleanupConnection();
// Having this after _cleanupConnection to just clean up the connection and not listen to ws.onclose
this.destroy({ reset: true, emit: false, log: false });
this.destroy({ reset: !this.sessionId, emit: false, log: false });
}
this.status = Status.DISCONNECTED;
this.emitClose(event);