From 915f939c6904b92297159317c509e578d8ae8f22 Mon Sep 17 00:00:00 2001 From: platfowner Date: Tue, 13 Aug 2024 10:23:31 +0900 Subject: [PATCH] Deprecate connection retry callback --- src/handlers/handler.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/handlers/handler.ts b/src/handlers/handler.ts index bbde682..9cb81d7 100644 --- a/src/handlers/handler.ts +++ b/src/handlers/handler.ts @@ -26,7 +26,7 @@ export default class Handler { async connect(connectionCb?: ConnectionCallback, disconnectionCb?: DisconnectionCallback, customClientId?: string) { this.checkEventManager(); - await this.ain.getEventManager().connect(connectionCb, this.connectionRetryCb.bind(this, connectionCb, disconnectionCb, customClientId)); + await this.ain.getEventManager().connect(connectionCb, disconnectionCb, customClientId); console.log('connected'); }; @@ -36,21 +36,6 @@ export default class Handler { console.log('Disconnected'); } - private async connectionRetryCb(connectionCb?: ConnectionCallback, disconnectionCb?: DisconnectionCallback, customClientId?: string, webSocket?: any) { - try { - if (disconnectionCb) { - disconnectionCb(webSocket); - } - const address = await AinModule.getInstance().getAddress(); - if (address) { - console.log('Disconnected. Reconnecting...'); - await this.connect(connectionCb, disconnectionCb, customClientId); - } - } catch (_) { - return; - } - } - async subscribe(subscribePath: string, resolve: any) { this.checkEventManager();