From 74ede31cd33587cfbade726fc96987d5d2b2cc7b Mon Sep 17 00:00:00 2001 From: Hoan Luu Huu <110280845+xquanluu@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:20:57 +0700 Subject: [PATCH] fix ws reconnect does not send verb:hook data (#633) --- lib/utils/ws-requestor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/utils/ws-requestor.js b/lib/utils/ws-requestor.js index ab38b278..d1841840 100644 --- a/lib/utils/ws-requestor.js +++ b/lib/utils/ws-requestor.js @@ -326,7 +326,9 @@ class WsRequestor extends BaseRequestor { 'WsRequestor:_onSocketClosed time to reconnect'); if (!this.ws && !this.connectInProgress) { 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 < 2000 ? this.backoffMs * 2 : (this.backoffMs + 2000);