Skip to content

Commit

Permalink
Deprecate connection retry callback
Browse files Browse the repository at this point in the history
  • Loading branch information
platfowner committed Aug 13, 2024
1 parent 9dc961c commit 915f939
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/handlers/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
};

Expand All @@ -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();

Expand Down

0 comments on commit 915f939

Please sign in to comment.