D
D
Dmitry Shelygin2019-01-14 18:48:51
Laravel
Dmitry Shelygin, 2019-01-14 18:48:51

How to run background processes in an infinite loop in Laravel?

You need to run 3 processes in the background, each of which will have to restart after a certain amount of time.
I did 3 jobs, in each I run it in a function, after which comes , for example. The queue driver is using async . I launch , I launch 3 , I transfer a new copy to each. job class. When running, it starts a few more attempts. If I specify --tries=1, then it throws an error that there is no failed_jobs table. It is also not clear whether all processes are working or only the first one called. Am I doing it right at all? while(true)sleep(21600)
php artisan queue:workdispatch()

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Novikov, 2019-01-15
@JustJew

For such a task, it is better to use the Scheduler , or cron

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question