Skip to content

Commit 7747948

Browse files
authored
Merge pull request #62 from chrisbygrave/disable-reconnect
Support non-reconnecting websockets
2 parents 4d2aa8e + 3e798dd commit 7747948

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

lib/websocket.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,11 @@ export class FireFlyWebSocket {
148148
if (!this.reconnectTimer) {
149149
this.close();
150150
this.logger.error(`Websocket closed: ${msg}`);
151-
this.reconnectTimer = setTimeout(() => this.connect(), this.options.reconnectDelay);
151+
if (this.options.reconnectDelay === -1) {
152+
// do not attempt to reconnect
153+
} else {
154+
this.reconnectTimer = setTimeout(() => this.connect(), this.options.reconnectDelay);
155+
}
152156
}
153157
}
154158

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hyperledger/firefly-sdk",
3-
"version": "1.2.5",
3+
"version": "1.2.6",
44
"description": "Client SDK for Hyperledger FireFly",
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",

0 commit comments

Comments
 (0)