Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Prido's avatar
Level 2

Jobs

I am creating a backend system and it relies on external data that i have to fetch from an API periodically per minute. This data might sometimes take more than a minute to import. I made the use of laravel scheduler to schedule my commands to fetch data. My question is, is it good to dispatch the fetching of data as a job or to execute it right away in schedular withouthOverlap?

0 likes
1 reply
bugsysha's avatar
bugsysha
Best Answer
Level 61

I usually use queues to speed up the time that it takes for me to respond to the client. So if I have something heavy that needs to be triggered during the request, but it doesn't have to be included in the response, I push it to the queue. If it is on a scheduled interval, then I leave it as a CRON job since it doesn't affect the request/response cycle.

Please or to participate in this conversation.