fix: (web3.js) clear the idle timer whenever the websocket closes (#26734)
fix: clear the idle timer whenever the websocket closes
This commit is contained in:
parent
f6d5b253fb
commit
f4100f621f
|
@ -4577,6 +4577,10 @@ export class Connection {
|
|||
_wsOnClose(code: number) {
|
||||
this._rpcWebSocketConnected = false;
|
||||
this._rpcWebSocketGeneration++;
|
||||
if (this._rpcWebSocketIdleTimeout) {
|
||||
clearTimeout(this._rpcWebSocketIdleTimeout);
|
||||
this._rpcWebSocketIdleTimeout = null;
|
||||
}
|
||||
if (this._rpcWebSocketHeartbeat) {
|
||||
clearInterval(this._rpcWebSocketHeartbeat);
|
||||
this._rpcWebSocketHeartbeat = null;
|
||||
|
|
Loading…
Reference in New Issue