From 2b3d2b8db50609b3156a3f5b8e5a64df2acabca8 Mon Sep 17 00:00:00 2001 From: Dmitry Leleko Date: Thu, 30 Jun 2022 15:21:35 +0300 Subject: [PATCH] OP-2481 Cleanup --- src/services/OrionAggregator/ws/index.ts | 4 ++-- src/services/PriceFeed/ws/PriceFeedSubscription.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/OrionAggregator/ws/index.ts b/src/services/OrionAggregator/ws/index.ts index db8e06b..5432043 100644 --- a/src/services/OrionAggregator/ws/index.ts +++ b/src/services/OrionAggregator/ws/index.ts @@ -144,7 +144,7 @@ const isSubType = (subType: string): subType is keyof Subscription => Object.val class OrionAggregatorWS { private ws: WebSocket | undefined; - private isClosedIntentionally: boolean = false; + private isClosedIntentionally = false; private subscriptions: Partial<{ [K in keyof Subscription]: Partial> @@ -263,7 +263,7 @@ class OrionAggregatorWS { init(isReconnect = false) { this.ws = new WebSocket(this.wsUrl); - this.ws.onclose = (e) => { + this.ws.onclose = () => { if (!this.isClosedIntentionally) this.init(true); }; this.ws.onopen = () => { diff --git a/src/services/PriceFeed/ws/PriceFeedSubscription.ts b/src/services/PriceFeed/ws/PriceFeedSubscription.ts index 36f257b..116fe15 100644 --- a/src/services/PriceFeed/ws/PriceFeedSubscription.ts +++ b/src/services/PriceFeed/ws/PriceFeedSubscription.ts @@ -74,7 +74,7 @@ export default class PriceFeedSubscription { + this.ws.onclose = () => { if (this.heartbeatInterval) clearInterval(this.heartbeatInterval); if (!this.isClosedIntentionally) this.init(); };