phplaravelqueuelaravel-5.1job-queue

How can I change the Job Queue processing in Laravel?


I have three jobs in my queue;

Retry count for one of them is set to 100.

When all my jobs are failing, Laravel runs the jobs as following scheme;

and then;

I want to change this behavior as the following scheme;

So I want the previous jobs to be blocking tikk they reach their retry counts and then continue to the next job.

How can I achieve this with Laravel’s Job system?

( I can’t chain the jobs on my software layer with chain method. I would like to achieve this by configuration )


Solution

  • If this is a job you cannot control another job from that one... Jobs are working asynchronously. You need to get things done synchronously :)

    So or you move everything into one job, or you cannot do it in another way :)

    Of course, you can name your queues, and run with prioritizing them and setup only 1 worker... But this isn't a good option and you cannot be good with that :)


    Also, you can fire job after one job is done. Just move creating a job from your controller(?) into the job after the finish. I have that solution implemented in my own system. Only if one job is done, then next is firing