You can try to do this:
$schedule->job(new YourJobHere)->daily()->between('4:00', '18:00');
This way your jobs will queue only between these hours.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi! I have a use case where I need to run a job queue during specific times. For example, I have a queue of jobs that I want to run between 4am to 6pm
It's making API calls and outside of those hours, I need to run the API calls for something else.
I've done much research, but haven't found anything except using a cronjob. I want to avoid using a cronjob because the API response could take 4 seconds or 20 seconds, so it's not efficient because that means I'm wasting time waiting 20 seconds for something that could have finished 16 seconds before.
I want it to be more efficient so as soon as one job finishes, it processes the next job which will result in more API calls per minute, rather than the limited 3 per minute if I'm running them every 20 seconds.
Any suggestions, tips, recommendations are appreciated!
TIA!
@jonathan1 Yes you can set priority on queues, it won't pause them but will prefer to do jobs with high priority (and you don't need two queues for this by the way).
If you are sending the jobs from a central location in your application you can throttle calls to the jobs by using a timeout.
Which API do you want to call and why all the limitations?
Please or to participate in this conversation.