Skip to content

Commit

Permalink
Merge pull request #13 from betamos/master
Browse files Browse the repository at this point in the history
Don't stop browsing after ~15min
  • Loading branch information
marten-seemann authored Sep 22, 2021
2 parents 41c0a97 + 6005a9a commit 9dfbd03
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ func (c *client) periodicQuery(ctx context.Context, params *lookupParams) error
bo := backoff.NewExponentialBackOff()
bo.InitialInterval = 4 * time.Second
bo.MaxInterval = 60 * time.Second
bo.MaxElapsedTime = 0
bo.Reset()

var timer *time.Timer
Expand All @@ -381,11 +382,8 @@ func (c *client) periodicQuery(ctx context.Context, params *lookupParams) error
if err := c.query(params); err != nil {
return err
}
// Backoff and cancel logic.
// Backoff logic
wait := bo.NextBackOff()
if wait == backoff.Stop {
return fmt.Errorf("periodicQuery: abort due to timeout")
}
if timer == nil {
timer = time.NewTimer(wait)
} else {
Expand Down

0 comments on commit 9dfbd03

Please sign in to comment.