Skip to content

Commit

Permalink
Reset the backoff time on successful connection
Browse files Browse the repository at this point in the history
  • Loading branch information
pjcdawkins committed Feb 14, 2023
1 parent a3b4b97 commit 4bcb6c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ func (c *Client) SubscribeWithContext(ctx context.Context, stream string, handle
}
defer resp.Body.Close()

// Successful connection: reset the backoff time.
c.ReconnectStrategy.Reset()

reader := NewEventStreamReader(resp.Body, c.maxBufferSize)
eventChan, errorChan := c.startReadLoop(reader)

Expand Down

0 comments on commit 4bcb6c8

Please sign in to comment.