Skip to content

Commit

Permalink
fixed error with infinite reconnects
Browse files Browse the repository at this point in the history
  • Loading branch information
hoeken committed Dec 22, 2023
1 parent f23c082 commit 08fcc6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class YarrboardClient {
this.config = false;
this.closed = false;
this.connectionRetryCount = 0;
this.maxConnectionRetries = 0; // 0 = try forever
this.maxConnectionRetries = -1; // -1 = try forever
this.state = "IDLE";
this.connectionStates = ["IDLE", "CONNECTING", "CONNECTED", "RETRYING", "FAILED"];

Expand Down Expand Up @@ -377,7 +377,7 @@ class YarrboardClient {
this.onclose(event);

//did we hit our max?
if (this.maxConnectionRetries > 0 && this.connectionRetryCount <= this.maxConnectionRetries)
if (this.maxConnectionRetries == -1 || this.connectionRetryCount <= this.maxConnectionRetries)
{
//update our retries
this.connectionRetryCount++;
Expand Down

0 comments on commit 08fcc6e

Please sign in to comment.