fix ws reconnect does not send verb:hook data (#633)

This commit is contained in:
Hoan Luu Huu
2024-01-31 22:20:57 +07:00
committed by GitHub
parent 048229f019
commit 74ede31cd3

View File

@@ -326,7 +326,9 @@ class WsRequestor extends BaseRequestor {
'WsRequestor:_onSocketClosed time to reconnect'); 'WsRequestor:_onSocketClosed time to reconnect');
if (!this.ws && !this.connectInProgress) { if (!this.ws && !this.connectInProgress) {
this.connectInProgress = true; this.connectInProgress = true;
this._connect().catch((err) => this.connectInProgress = false); return this._connect()
.catch((err) => this.logger.error('WsRequestor:_onSocketClosed There is error while reconnect', err))
.finally(() => this.connectInProgress = false);
} }
}, this.backoffMs); }, this.backoffMs);
this.backoffMs = this.backoffMs < 2000 ? this.backoffMs * 2 : (this.backoffMs + 2000); this.backoffMs = this.backoffMs < 2000 ? this.backoffMs * 2 : (this.backoffMs + 2000);