Running laravel queue:work on a shared hosting

后端 未结 6 1927
你的背包
你的背包 2020-12-18 01:45

I want my laravel queue:work to keep running on a shared hosting, this is a shared hosting (am not on a VPS) I can\'t install anything because almost all on

6条回答
  •  别那么骄傲
    2020-12-18 02:02

    Try adding two cron jobs:

    1. To clear cache:
    /usr/local/bin/php /home//artisan cache:clear
    
    1. To run the scheduler
    /usr/local/bin/php /home//artisan schedule:run
    

    Also, make sure that your app\Console\Kernel.php is having something like

    protected function schedule(Schedule $schedule)
        {
            $schedule->command('queue:work --tries=3')
                ->cron('* * * * *')
                ->withoutOverlapping(5);
        }
    

    Remove the first job (the one to remove cache) if the queue starts working

提交回复
热议问题