mardi 3 juillet 2018

Laravel: Running The Queue Worker on a managed Server

I have a managed server that is occasionally updated and restarted. That means if I just start a work process:

php artisan queue:work

it will only work for a couple of weeks until the server is restarted.

What I can do is to define a permanent cronjob that calls every minute

php artisan queue:work --once

This works so far, but I have two questions about it:

  1. If a job takes longer then a minute, will this approach execute the same job twice? In other words: can you call the queue worker parallel?

  2. I would like to do something like "do 5 jobs per minute but make sure to have a 5 seconds sleep between jobs" something like php artisan queue:work --sleep=5 --five. Is that possible?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire