Skip to content

Comments

Better retry handling#981

Merged
mre merged 1 commit intomasterfrom
refactor-client2
Mar 10, 2023
Merged

Better retry handling#981
mre merged 1 commit intomasterfrom
refactor-client2

Conversation

@mre
Copy link
Member

@mre mre commented Mar 9, 2023

Previously, lychee would blindly retry all requests,
no matter if the request error was transient or fatal.

Taking a lesson from https://github.com/TrueLayer/reqwest-middleware,
we can be more granular about the error behavior.
This PR adds their retry logic to lychee, reducing the number of
unnecessary requests significantly.

I also made some ergonomic changes to the client, which should not
affect its behavior.

@mre mre force-pushed the refactor-client2 branch from 73fe770 to 0206188 Compare March 9, 2023 11:02
Previously, lychee would blindly retry all requests,
no matter if the request error was transient or fatal.

Taking a lesson from https://github.com/TrueLayer/reqwest-middleware,
we can be more granular about the error behavior.
This PR adds their retry logic to lychee, reducing the number of
unnecessary requests significantly.

I also made some ergonomic changes to the client, which should not
affect its behavior.
@mre mre force-pushed the refactor-client2 branch from 0206188 to 3637848 Compare March 10, 2023 21:29
@mre mre merged commit 2255ad9 into master Mar 10, 2023
@mre mre deleted the refactor-client2 branch March 10, 2023 21:36
@lebensterben
Copy link
Member

btw there's a crate specialises on retry strategies: https://github.com/Xuanwo/backon.

@mre mre mentioned this pull request Mar 11, 2023
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

Successfully merging this pull request may close these issues.

2 participants