Current timeout is 30s, this add a second kind of timeout : if connection to remote can’t be established in 5s, the remote is considered down, so that a thread don’t stall for too long for no reason (and also make some unit test much faster to run)
elegaanz(Migrated from github.com)
approved these changes 1 year ago
It makes me think: couldn’t we have a unique client (in a lazy_static! or something like that). I think reqwest keep connections for a certain time if the client is not dropped, and it probably caches DNS too.
Otherwise, it looks good to me, so if the CI is happy you can merge.
maybe not a unique client (if we have multiple request to do at the same time they will be queued), but we could probably make some kind of pool of clients. I’ll keep the idea somewhere for when I have spare time to spend