8000 [11.x] Pass the limiter to the when & report callbacks by jimmypuckett · Pull Request #56129 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[11.x] Pass the limiter to the when & report callbacks #56129

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

Conversation

jimmypuckett
Copy link
Contributor

It would be nice to have the limiter in the when & report callbacks to expand the logic in the closures to give a bit more control.

Here is a use case:

I want to give the job the maxAttempts to recover, but on that last try, it would be nice to report what is happening. I would like not to report the attempts 1...(max - 1), but on max, I would like to report. If I had the limiter in my closure, then I would know when to return true. This would keep the logs clean for the occasional exception that self-recover.

I have started a discussion on this at #56128, but then I thought that would make the simple PR.

I did not see where the tests were making any assertions about the parameters being passed, so I did not make any test changes. However, I will be happy to expand them if needed.

@taylorotwell taylorotwell merged commit 372a22a into laravel:11.x Jun 25, 2025
23 of 60 checks passed
@jimmypuckett
Copy link
Contributor Author

Thanks! Looking forward to the next release.

@jimmypuckett jimmypuckett deleted the passLimiterToThrottlesExceptions branch June 25, 2025 17:33
GrahamCampbell added a commit that referenced this pull request Jul 1, 2025
taylorotwell pushed a commit that referenced this pull request Jul 1, 2025
GrahamCampbell added a commit that referenced this pull request Jul 1, 2025
@GrahamCampbell
Copy link
Member
GrahamCampbell commented Jul 1, 2025

@jimmypuckett This has been reverted on 11.x. 11.x is only taking bug and security fixes at this time.

I've re-created this PR for 12.x at #56187.

taylorotwell pushed a commit that referenced this pull request Jul 1, 2025
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.

3 participants
0