OP-2481 Fixup

This commit is contained in:
Dmitry Leleko
2022-06-30 15:39:58 +03:00
parent 2b3d2b8db5
commit 2976f422c4
2 changed files with 3 additions and 0 deletions

View File

@@ -262,6 +262,7 @@ class OrionAggregatorWS {
}
init(isReconnect = false) {
this.isClosedIntentionally = false;
this.ws = new WebSocket(this.wsUrl);
this.ws.onclose = () => {
if (!this.isClosedIntentionally) this.init(true);

View File

@@ -93,6 +93,8 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
}
init() {
this.isClosedIntentionally = false;
const { payload, url, type } = this;
this.ws = new WebSocket(`${url}/${type}${payload ? `/${payload.toString()}` : ''}`);