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

better retry API #58

Closed
xenoterracide opened this issue Mar 22, 2022 · 0 comments
Closed

better retry API #58

xenoterracide opened this issue Mar 22, 2022 · 0 comments

Comments

@xenoterracide
Copy link

I wrote this, and I don't think it even does what I mean, certainly doesn't seem like it's the same as calling exponential().attempts(...)

    const attempts = retryAttempts ?? this.props.retryAttempts
    const backoff = this.exponentialBackoff
      ? new ExponentialBackoff({
          maxAttempts: attempts,
        })
      : new ConstantBackoff(5, attempts) // for testing

    const retryPolicy = Policy.handleAll().retry().backoff(backoff).attempts(attempts)

I feel like this would be an improvement

Policy.handleAll().retry().backoffStrategy(BackoffStrategyType.EXPONENTIAL).attempts(5)
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