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

[8.x] Accept closure for retry() sleep #38035

Merged
merged 1 commit into from
Jul 16, 2021

Conversation

bonroyage
Copy link
Contributor

With this change the retry() helper will also accept a closure for the $sleepMilliseconds argument (instead of only an integer). This closure will receive the $attempts variable, allowing the user to change the delay based on the number of attempts. For example, waiting 100ms after the first attempt and 200ms after the second attempt, etc.

@taylorotwell taylorotwell merged commit 035a0b2 into laravel:8.x Jul 16, 2021
@bonroyage bonroyage deleted the retry-backoff branch July 16, 2021 13:39
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