Skip to content

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
Collaborator

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
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
mohammad-fouladgar pushed a commit to mohammad-fouladgar/framework that referenced this pull request Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants