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);