Skip to content

Commit

Permalink
Merge pull request #62 from chrisbygrave/disable-reconnect
Browse files Browse the repository at this point in the history
Support non-reconnecting websockets
  • Loading branch information
awrichar committed Feb 1, 2023
2 parents 4d2aa8e + 3e798dd commit 7747948
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/websocket.ts
Expand Up @@ -148,7 +148,11 @@ export class FireFlyWebSocket {
if (!this.reconnectTimer) {
this.close();
this.logger.error(`Websocket closed: ${msg}`);
this.reconnectTimer = setTimeout(() => this.connect(), this.options.reconnectDelay);
if (this.options.reconnectDelay === -1) {
// do not attempt to reconnect
} else {
this.reconnectTimer = setTimeout(() => this.connect(), this.options.reconnectDelay);
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@hyperledger/firefly-sdk",
"version": "1.2.5",
"version": "1.2.6",
"description": "Client SDK for Hyperledger FireFly",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down

0 comments on commit 7747948

Please sign in to comment.