laravel-queue-rate-limit | Simple Laravel queue rate limiting | Web Framework library
kandi X-RAY | laravel-queue-rate-limit Summary
kandi X-RAY | laravel-queue-rate-limit Summary
Simple Laravel queue rate limiting
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Get next job
- Register the worker class .
- Logs a message .
- Register the Logger
- Register the queue logger .
laravel-queue-rate-limit Key Features
laravel-queue-rate-limit Examples and Code Snippets
Community Discussions
Trending Discussions on laravel-queue-rate-limit
QUESTION
I am using Laravel Horizon and Redis and I am trying to throttle it. I am using an external API that has a rate limit of 100 requests per minute. I need to make about 700 requests. I have it setup so that every job I add to the queue only performs one API call in the job itself. So if I throttle the queue I should be able to stay within the limits. For some reason no throttling is happening and it instead blows through the queue (thus triggering many API errors of course). However the throttle works locally just not on my server.
I was originally trying to throttle per Laravel's queue documentation but could only get it to work locally so I swapped to trying out the laravel-queue-rate-limit package on Github. As per the README I added the following to my queue.php
config file:
ANSWER
Answered 2020-Jul-06 at 13:59It looks like the package you mention (laravel-queue-rate-limit) does not work well with Horizon. You're probably better off using Laravel's built-in method.
In Laravel's queue, add ->block(60)
to match ->every(60)
so that the default timeout does not kick in and invoke another callback before 60 seconds.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install laravel-queue-rate-limit
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page