Commit Graph

27 Commits (6fdc6773f8ffdfadf9e74c63781b5e3d3a72c72e)

Author SHA1 Message Date
Ethan Brierley 6fdc6773f8 Revert "Code review suggestions"
This reverts commit 211a6dea9f.
2024-08-28 22:37:11 +01:00
Piotr Zaczkowski 211a6dea9f Code review suggestions 2024-08-28 22:37:06 +01:00
Piotr Zaczkowski d5290d056f Simplify 2024-08-28 22:37:06 +01:00
Piotr Zaczkowski d966ad89e5 Fix empty and different level naming 2024-08-28 22:37:06 +01:00
Piotr Zaczkowski 4ea0e42bcd Correct `use` 2024-08-28 22:37:06 +01:00
Piotr Zaczkowski 939681cd93 WIP... 2024-08-28 22:37:06 +01:00
Ethan Brierley c54a7733b9 fix(lint): `clippy::doc_lazy_continuation`
```
error: doc list item missing indentation
Error:   --> reqwest-retry/src/middleware.rs:62:4
   |
62 | /// `Body`'s `From<String>` or `From<Bytes>` implementations.
   |    ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
   = note: `-D clippy::doc-lazy-continuation` implied by `-D warnings`
   = help: to override `-D warnings` add `#[allow(clippy::doc_lazy_continuation)]`
help: indent this line
   |
62 | ///   `Body`'s `From<String>` or `From<Bytes>` implementations.
   |     ++

error: doc list item missing indentation
Error:   --> reqwest-retry/src/middleware.rs:65:4
   |
65 | /// source directly, avoiding the issue of streaming requests not being clonable.
   |    ^
   |
   = help: if this is supposed to be its own paragraph, add a blank line
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_lazy_continuation
help: indent this line
   |
65 | ///   source directly, avoiding the issue of streaming requests not being clonable.
   |     ++

error: could not compile `reqwest-retry` (lib) due to 2 previous errors
```
2024-07-29 20:28:02 +01:00
pvichivanives 2927624652
Bump retry-policies to 0.4 (#155)
* bump reqwest to 0.4

* Update reqwest-retry/src/middleware.rs

Co-authored-by: Chris Beck <5683852+cbeck88@users.noreply.github.com>

* fix unwrap issue

---------

Co-authored-by: Chris Beck <5683852+cbeck88@users.noreply.github.com>
Co-authored-by: Ethan Brierley <ethanboxx@gmail.com>
2024-06-01 02:02:26 +01:00
Chris Beck 3ae02fcd8b
add re-exports from retry-policies crate (#157)
fixes #84
2024-06-01 01:57:43 +01:00
Simon abdf1844c3
feat(reqwest-retry): Configurable log level for retry event (#137)
* Make retry log level configurable

* Add Changelog entry

* Update macro

* Add comment with issue to macro

* Update CHANGELOG
2024-04-11 10:16:33 +01:00
Conrad Ludgate 60212ae451
reqwest 0.12 and other breaking changes (#135)
* update reqwest and http crates

remove task_local_extensions

* remove older opentelemetry packages

* remove more legacy and add new otel

* attempt to make features additive

* features are additive

* delete commented out code

* build split

* docs

* more uniform with reqwest::Client

* remove arcs

* slight optimisation

* update readmes

* update changelog
2024-04-03 18:13:10 +01:00
Vasiliy Taranov 2a3f239a05
fix typos, add github action (#122) 2024-03-12 15:10:18 +00:00
bbaldino 4bdf56f2e0
Adapt to retry-policies changes (#113) 2024-03-05 12:05:19 +00:00
Ethan Brierley d297b1c5df
chore: `cargo fmt` 2023-11-07 09:59:22 +00:00
Jan Srzednicki b7017dca6f
Document using `tokio::time::sleep` (#111)
* Document using `tokio::time::sleep`

* Update reqwest-retry/src/middleware.rs

---------

Co-authored-by: Ethan Brierley <ethanboxx@gmail.com>
2023-11-07 09:35:16 +00:00
Ethan Brierley 304d6f1ebc
ci: fix `rustdoc::redundant_explicit_links` (#110) 2023-10-24 10:50:53 +01:00
Rutger 594075583c
Added a way to specify custom functions which decide whether a request should be retried or not (#33)
* Add a generic function to the middleware struct for the `Retryable` decision.

The generic function can be used to define custom behaviour to decide whether to retry a request or not.

By default, this function is `Retryable::from_reqwest_response` which is the same as it was before.

* Add a way to create custom retry policies.

A RetryStrategy will dictate what decision will be made based on the result of the sent request.

* Add RetryableStrategy in the `RetryTransientMiddleware` struct instead of the seperate functions

* Add constructor to create a `RetryTransientMiddleware` with a custom `RetryableStrategy`

* Run `cargo fmt`

* Add example code to the `RetryableStrategy` struct

* Run `cargo fmt`

* Updated changelog

* use a trait

* docs

* include latest changes

Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
2023-05-22 11:53:31 +01:00
Matthew Gapp f8ff599f50
fix: remove middleware retry limit (#87)
* refactor: Simplify retry middleware in reqwest.

Removed retry limit:

- Remove MAXIMUM_NUMBER_OF_RETRIES metadata and references in middleware.rs
- Correct mispelling: retry_decision to retry_decision in middleware.rs
- Update Retryable matching to only match Retryable::Transient in middleware.rs
- Simplify branching by removing n_past_retries < MAXIMUM_NUMBER_OF_RETRIES condition in middleware.rs

* test: Remove retry cap assertion from test file

remove retry limit assertion test
2023-04-17 13:02:13 +01:00
Léo Gaspard fef18b3506
feat: wasm32-unknown-unknown support (#79)
* feat: wasm32-unknown-unknown support

This replaces task-local-extensions with http's extensions, as http was
already in the dependency closure anyway and the other features of
task-local-extensions (that required an incompatible-with-wasm part of
tokio) were not used anyway.

* feat: have ci check that wasm32-unknown-unknown keeps compiling

* revert back to task-local-extensions

* fix ci

* fix random on wasm

* fix ci again

* bump

---------

Co-authored-by: Conrad Ludgate <conrad.ludgate@truelayer.com>
2023-03-09 11:33:13 +00:00
tl-helge-hoff f854725791
feat: classify io error connection reset by peer (#78)
* feat: classify io error connection reset by peer

* doc: explain tests

* chore: add changelog

* fix: use and_then

* chore: docs and clippy

* chore: bump reqwest-retry to 0.2.1

* fix: use get_source_error_type

* fix: remove unused import

* fix: make clippy happy

* doc: describe canceled
2022-12-02 10:57:24 +01:00
tl-rodrigo-gryzinski e2635c9f8d
Add note about streaming requests in RetryTransientMiddleware docs (#51) 2022-07-21 16:39:15 +01:00
Conrad Ludgate b3f7ce40d3
fix recursion in retry (#49) 2022-07-09 23:34:23 +01:00
Luca Palmieri 525f62039f
Fix clippy lint. (#23) 2021-12-06 16:06:23 +00:00
Alessandro C dc6f1b460f
fix(retry): handle hyper::Error(IncompleteMessage) as Transient (#14) 2021-10-18 12:18:47 +02:00
tl-rodrigo-gryzinski 9c82a35a90
chore: Move to task-local-extensions (#9)
* chore: Move to task-local-extensions
2021-09-28 19:50:23 +01:00
tl-rodrigo-gryzinski b8645f81eb
Include README in crate doctests and improve documentation (#8)
* chore: Improve docs and include some examples in doctests
2021-09-28 19:26:03 +01:00
Rodrigo Gryzinski 7fe55152ec Initial commit 2021-08-13 08:59:58 +01:00