feat(): safer websocket timer cleanup

This commit is contained in:
tiagosiebler
2023-12-22 10:53:22 +00:00
parent a2cc9f5b9b
commit 923b1b02e0

View File

@@ -808,11 +808,11 @@ export class WebsocketClient extends EventEmitter {
const wasOpen = this.wsStore.isWsOpen(wsKey);
this.getWs(wsKey)?.terminate();
delete this.wsStore.get(wsKey, true).activePongTimer;
this.clearPingTimer(wsKey);
this.clearPongTimer(wsKey);
this.getWs(wsKey)?.terminate();
if (!wasOpen) {
this.logger.info(
`${reason} - socket already closed - trigger immediate reconnect`,