Skip to content

Commit

Permalink
fix: check for exceeded backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
philippseith committed Sep 12, 2023
1 parent e93586f commit 44901b4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,14 @@ func (c *client) Start() {
boff.Reset()
}
// Reconnect after BackOff
nextBackoff := boff.NextBackOff()

Check warning on line 204 in client.go

View check run for this annotation

Codecov / codecov/patch

client.go#L204

Added line #L204 was not covered by tests
// Check for exceeded backoff
if nextBackoff == backoff.Stop {
c.setErr(errors.New("backoff exceeded"))
return

Check warning on line 208 in client.go

View check run for this annotation

Codecov / codecov/patch

client.go#L206-L208

Added lines #L206 - L208 were not covered by tests
}
select {
case <-time.After(boff.NextBackOff()):
case <-time.After(nextBackoff):

Check warning on line 211 in client.go

View check run for this annotation

Codecov / codecov/patch

client.go#L211

Added line #L211 was not covered by tests
case <-c.ctx.Done():
return
}
Expand Down

0 comments on commit 44901b4

Please sign in to comment.