Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: set a timeout for the entire retry operation #73

Open
fastfrwrd opened this issue Aug 3, 2020 · 0 comments
Open

Feature: set a timeout for the entire retry operation #73

fastfrwrd opened this issue Aug 3, 2020 · 0 comments

Comments

@fastfrwrd
Copy link

I find myself doing this a lot when using async-retry:

await Promise.race(
  retry(/* ... */),
  new Promise((_, reject) => {
    setTimeout(() => {
      reject(new Error('FAILED to complete async retry in less than 1 minute'))
    }, 60000)
  }),
)

It would be awesome if there were a clean way to provide an option (retryTimeout?) that allowed you to say ("time out after the retry went for this long, regardless of the attempt number").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant