Skip to content

Commit

Permalink
backoff with context for ctrl-c
Browse files Browse the repository at this point in the history
Signed-off-by: Morgan Gallant <[email protected]>
  • Loading branch information
morgangallant committed Dec 14, 2024
1 parent dde4dc5 commit 4dfec13
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (ns *namespace) upsertDocumentsBatched(
}
return err
}
if err := backoff.Retry(f, backoff.NewExponentialBackOff()); err != nil {
if err := backoff.Retry(f, backoff.WithContext(backoff.NewExponentialBackOff(), ctx)); err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return nil
}
Expand Down

0 comments on commit 4dfec13

Please sign in to comment.