does queue:work actually return? is it not designed to keep running? your withoutOverlapping will leave a mutex behind that stops other schedules.
Nov 24, 2017
5
Level 3
Laravel second task schedule never runs
I have cron entry at shared hosting:
-
-
-
-
- php web/artisan schedule:run
-
-
-
The problem is that queue:work command works no matter the order, but second task (Closure) that updates video views never runs.
Code from Kernel.php:
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
//Each Video total_video_views will be accurately updated on daily basis.
$schedule->call(function () {
$videos = Video::get();
app('queue')->pushOn('high', new UpdateVideoViews($videos));
})->hourlyAt('30')
->name('updates all video views')
->withoutOverlapping();
//this is alternative to supervisor since shared hosting someties doesnt provide supervisor
//so we use cron instead to keep queue worker up
$schedule->command('queue:work --queue=high,default')
->everyMinute()
->name('keeps queue worker active')
->withoutOverlapping();
}
Is there any way to run it? My suspiction is that queue:work command along "withoutOverlapping()" is kinda maybe blocking any other tasks to process.
Level 122
then you need to switch to a host that allows you to run supervisor in a separte thread
Please or to participate in this conversation.