kitsuyui / rust-codecov

Codecov API (v2) package for Rust https://about.codecov.io/blog/getting-started-with-the-codecov-api-v2/
0 stars 1 forks source link

Add retry logic #86

Open kitsuyui opened 3 weeks ago

kitsuyui commented 3 weeks ago

Add retry logic to Client. Currently, if an error occurs, it fails immediately. However, Codecov's API returns 5xx errors quite often. By adding retry logic, you can retry even if the API is temporarily down. Retry only when the API returns a specific error.

I think it would be even better if the retry count and interval for 5xx errors could be exponential backoff. Maybe the reqwest-retry crate has that feature. reqwest-retry

kitsuyui commented 3 weeks ago

According to this issue , reqwest-middleware does not support blocking Clients.

When I try to use it, I get an error like this:

mismatched types
expected `reqwest::Client`, found `reqwest::blocking::Client`rustcClick for full compiler diagnostic

It might be a good idea to support Client based on async.