Skip to content

feat(retry-custom-delay): add support for custom delay function based on attempts #1117

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

Merged
merged 7 commits into from
Apr 16, 2025

Conversation

kim-sung-jee
Copy link
Contributor

What’s Changed

adds support for customizing the retry delay based on the current attempt count via a user-defined function.

This work continues from the discussion in #940, where we explored adding jitter/backoff strategies while keeping the implementation simple.

  • RetryOptions.delay now accepts a function (attempts: number) => number

  • Test cases updated to verify behavior with both fixed and dynamic delays

  • Used performance.now() in tests for more accurate delay measurements

Copy link

vercel bot commented Apr 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
es-toolkit ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 5, 2025 6:44am

Copy link
Collaborator

@raon0211 raon0211 left a comment

Choose a reason for hiding this comment

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

Perfect. Thanks so much for your contribution!

@raon0211 raon0211 merged commit 662466e into toss:main Apr 16, 2025
8 of 9 checks passed
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.

2 participants