You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Which application or package is this feature request for?
rest
Feature
I want to implement exponential back-off when a request is retried due to a 5xx or timeout error. However currently retries are always immediate, so I would need to set RESTOptions#retries to 0 and then create a function like this:
strongly agree. we've discovered that sometimes, discord's API calls take 10s+, despite not being ratelimited (i.e. they do not return 429, just take a long time).
our workaround is lowering the timeout from 15s (default) to 3s. however, it'd be much nicer to be able to do some sort of exponential backoff.
As for an API, I'd propose that timeout could take a number or a function, like:
timeout: (retryCount: number) => number
so you could let API users implement whatever timeout logic they want
Which application or package is this feature request for?
rest
Feature
I want to implement exponential back-off when a request is retried due to a 5xx or timeout error. However currently retries are always immediate, so I would need to set
RESTOptions#retries
to 0 and then create a function like this:This is far from ideal, and it seems reasonable to implement this in the library instead.
Ideal solution or implementation
Adding to the
RESTOptions
seems like the obvious choice.Alternative solutions or implementations
No response
Other context
This was sparked by a question in the discord server.
The text was updated successfully, but these errors were encountered: