Skip to content

Commit

Permalink
Merge pull request #177 from philippseith/bugfix/end_client_after_bac…
Browse files Browse the repository at this point in the history
…koff_maxtime

fix: check for exceeded backoff
  • Loading branch information
philippseith authored Sep 12, 2023
2 parents e93586f + 44901b4 commit e607000
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 for exceeded backoff
if nextBackoff == backoff.Stop {
c.setErr(errors.New("backoff exceeded"))
return
}
select {
case <-time.After(boff.NextBackOff()):
case <-time.After(nextBackoff):
case <-c.ctx.Done():
return
}
Expand Down

0 comments on commit e607000

Please sign in to comment.