msslgomez
1 month ago
303
9
Laravel

Queue worker only processes 2 jobs then stops

Posted 1 month ago by msslgomez

I'm trying to learn how to use queues but I'm confused on whyphp artisan queue:work only processes 2 jobs and then quits when I have over 100 jobs in the database table.

The purpose for my queue is creating excel reports and finally creating a zip file and downloading it, if I run queue:listen it completes all the jobs but it never stops which is probably the indented outcome. My job consists of only creating the excel and saving it to storage/app. Right now I'm not sure what to do about creating the zip, as in how I would trigger a method with the logic or how I can do that part after all the jobs are completed.

Basically what I'm trying to achieve is to process all the jobs automatically without me having to run the queue:work 50 times and after there are no more jobs to then also automatically create the zip with all the files and download it.

Any help or suggestions are greatly appreciated.

Please sign in or create an account to participate in this conversation.