fix(WebSocketShard): clear listeners on reconnect (#8927)

This commit is contained in:
Qjuh
2022-12-14 22:23:20 +01:00
committed by GitHub
parent b14604abde
commit aa8c57dab6

View File

@@ -602,6 +602,9 @@ class WebSocketShard extends EventEmitter {
`[WebSocket] did not close properly, assuming a zombie connection.\nEmitting close and reconnecting again.`,
);
// Cleanup connection listeners
this._cleanupConnection();
this.emitClose();
// Setting the variable false to check for zombie connections.
this.closeEmitted = false;