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

Feature request: prevent to send duplicate errors #41

Open
vmrfriz opened this issue Apr 5, 2024 · 1 comment
Open

Feature request: prevent to send duplicate errors #41

vmrfriz opened this issue Apr 5, 2024 · 1 comment

Comments

@vmrfriz
Copy link

vmrfriz commented Apr 5, 2024

Problem:
When external services are down, I continuously receive messages about it, several messages per second.

Solution:
Make a setting for limiting the number of identical messages per unit of time.

I can do this and offer a pull-request. I think this can be done using the Cache facade. But I'm not sure if this is the best way. If there are other options, tell me and I will make a pull request.

@swaty007
Copy link

swaty007 commented Dec 7, 2024

Laravel already have it, In Handler.php file you can write

public function throttle(Throwable $e)
{
if ($e instanceof YourException) {
return Limit::perMinute(30);
}
}

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

No branches or pull requests

2 participants