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

ExponentialBackoffTimed did't impl RetryPolicy #106

Closed
RecordingTheSmile opened this issue Sep 9, 2023 · 1 comment
Closed

ExponentialBackoffTimed did't impl RetryPolicy #106

RecordingTheSmile opened this issue Sep 9, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@RecordingTheSmile
Copy link

Bug description

ExponentialBackoffTimed did't impl RetryPolicy, which occur error when use build_with_total_retry_duration() fn in ExponentialBackoff::builder.

To Reproduce

reqwest_retry::RetryTransientMiddleware::new_with_policy(
            reqwest_retry::policies::ExponentialBackoff::builder()
                .retry_bounds(
                    std::time::Duration::from_secs(1),
                    std::time::Duration::from_secs(2 * 60),
                )
                .build_with_total_retry_duration(Duration::from_secs(100)),
        );

Expected behavior

rustc should not raise an error.

Environment

  • OS: Windows
  • Rust version 1.72

Additional context

@RecordingTheSmile RecordingTheSmile added the bug Something isn't working label Sep 9, 2023
@tl-rodrigo-gryzinski
Copy link
Contributor

tl-rodrigo-gryzinski commented Sep 12, 2023

Hey!

This was a breaking change in retry-policies 0.2, it was required to fix a bug in the jitter implementation. Now you have to provide the time when the first requested started as well to get a RetryPolicy impl from ExponentialBackoffTimed, with ExponentialBackoffTimed::for_task_started_at

Details about the retry-policies change in this PR.

I'm closing the issue as this is intended behaviour, though feel free to add any comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants