Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(retry): 3x initial delay on 429s #2312

Merged
merged 6 commits into from
Jun 20, 2024
Merged

Conversation

jonahkaye
Copy link
Member

Refs: #1667

Description

  • longer initial delay on 429s

Testing

  • Local
    • added unit tests

Release Plan

  • Merge this

headers: new AxiosHeaders(),
method: "post",
url: "",
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I needed to pass all this stuff in to conform to Axios typing

expect(fn).toHaveBeenCalledTimes(2);
expect(spyDefaultGetTimeToWait).toHaveBeenCalledWith(
expect.objectContaining({
initialDelay: 3,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ensuring delay was 3x as long

@jonahkaye jonahkaye marked this pull request as ready for review June 20, 2024 13:34
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
Refs: #1667
Signed-off-by: Jonah Kaye <[email protected]>
Copy link
Member

@leite08 leite08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Comment on lines +37 to +43
function getHttpStatusFromError(error: unknown): number | undefined {
return axios.isAxiosError(error) ? error.response?.status : undefined;
}

function getHttpCodeFromError(error: unknown): string | undefined {
return axios.isAxiosError(error) ? error.code : undefined;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😍

@jonahkaye jonahkaye added this pull request to the merge queue Jun 20, 2024
Merged via the queue into develop with commit c4f9964 Jun 20, 2024
11 checks passed
@jonahkaye jonahkaye deleted the 1667-special-wait-logic-429s branch June 20, 2024 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants