fix: destroy options during cleanup (#8082)

This commit is contained in:
Voxelli
2022-06-13 23:33:56 +05:30
committed by GitHub
parent 613fd43fcf
commit afb18b99b7
2 changed files with 4 additions and 3 deletions

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);