feat(): safer websocket timer cleanup
This commit is contained in:
@@ -808,11 +808,11 @@ export class WebsocketClient extends EventEmitter {
|
|||||||
|
|
||||||
const wasOpen = this.wsStore.isWsOpen(wsKey);
|
const wasOpen = this.wsStore.isWsOpen(wsKey);
|
||||||
|
|
||||||
this.getWs(wsKey)?.terminate();
|
|
||||||
delete this.wsStore.get(wsKey, true).activePongTimer;
|
|
||||||
this.clearPingTimer(wsKey);
|
this.clearPingTimer(wsKey);
|
||||||
this.clearPongTimer(wsKey);
|
this.clearPongTimer(wsKey);
|
||||||
|
|
||||||
|
this.getWs(wsKey)?.terminate();
|
||||||
|
|
||||||
if (!wasOpen) {
|
if (!wasOpen) {
|
||||||
this.logger.info(
|
this.logger.info(
|
||||||
`${reason} - socket already closed - trigger immediate reconnect`,
|
`${reason} - socket already closed - trigger immediate reconnect`,
|
||||||
|
|||||||
Reference in New Issue
Block a user