I'm running Laravel on a hosting environment that doesn't support Supervisord, and am using Redis as the queue driver. I'd like to run my own custom script to ensure that the queue listening is always up
I've put into AppServiceProvider, into the boot function, some code to achieve this:
\Queue::failing(function (JobFailed $event) {
// some code to check whether the queue is completely failing or whether it's specific to the job
//then if if it is completely failing, run this code:
Artisan::call('queue:restart');
Artisan::call('queue:work', [
'--tries' => 2
]);
}
Usually to do this I would SSH in and run nohup php artisan queue:work --tries=2 > /dev/null 2>&1 &
How can I capture the last few parameters/options (no logging etc) in the Artisan::call()? I assume the nohup is redundant here?
Thanks
via user6122500