Add totalTimeout option and make timeout be per retry#848
Conversation
|
In aac83fa, I changed Ky to make timeout apply to the whole operation. However, doing some research now, I realize most HTTP clients across languages treat
The only exception is axios-retry, which defaults to total (with a So, I'm wondering whether we should make Thoughts? |
|
The most intuitive model to me is where I provide the That said, I think it's perfectly valid to want to also timeout the whole operation. The current behavior seems kind of backwards to me, though. It says, "By default, |
|
I found a better approach. |
retry.resetTimeout option to reset timeout budget on each retrytotalTimeout option
totalTimeout optiontotalTimeout option and make timeout be per retry
22f316c to
6d6700f
Compare
|
I think it's pretty good but the difference between the timeout options is a little unclear at first glance. Maybe we should rename them?
|
|
Every major HTTP client uses plain |
|
I have tried to make the docs clearer though. |
Make `timeout` per-attempt by default, matching how every major HTTP client works. Each retry now gets the full timeout value.
f7333f7 to
d96ff8a
Compare
Fixes #497