Skip to content

Suggestion: Retry's delay with error parameter like shouldRetry #1707

@GerroDen

Description

@GerroDen

Hi,

We already replaced all of lodash with es-toolkit and now came forward to replace other dependencies as well in order to have less dependencies.
One very reliable source that we use is https://github.com/vercel/async-retry.
The API is a little sluggish and out-dated.

One main feature of it is, that we can implemented our own waiting time after a response delivered a status code like 429.
The response has HTTP headers that tell how long to wait before trying again.
We are doing this in the main function itself, wait and rethrow. But it looks promising that we could do this within the delay option if the error would be available as parameter, just like it is in shouldRetry
So the delay depends on the thrown error from the original function.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions