OP-2481 Minor update

This commit is contained in:
Dmitry Leleko
2022-06-30 16:12:27 +03:00
parent 2976f422c4
commit 8f9d1f9413
2 changed files with 8 additions and 0 deletions

View File

@@ -144,6 +144,10 @@ const isSubType = (subType: string): subType is keyof Subscription => Object.val
class OrionAggregatorWS {
private ws: WebSocket | undefined;
// is used to make sure we do not need to renew ws subscription
// we can not be sure that onclose event will recieve our code when we do `ws.close(4000)`
// since sometimes it can be replaced with system one.
// https://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed-with-close-code-1006
private isClosedIntentionally = false;
private subscriptions: Partial<{

View File

@@ -74,6 +74,10 @@ export default class PriceFeedSubscription<T extends SubscriptionType = Subscrip
readonly type: T;
// is used to make sure we do not need to renew ws subscription
// we can not be sure that onclose event will recieve our code when we do `ws.close(4000)`
// since sometimes it can be replaced with system one.
// https://stackoverflow.com/questions/19304157/getting-the-reason-why-websockets-closed-with-close-code-1006
private isClosedIntentionally = false;
constructor(