vendredi 30 juin 2017

Laravel task scheduler for artisan command queue:work not working in shared hosting

I have problem to run artisan queue:work command using task scheduling in laravel 5.3

app/Console/Kernel.php code

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel {
    protected $commands = [];

    \Log::info('schedule:run');
    protected function schedule(Schedule $schedule)
    {
        $schedule->command('queue:work --tries=3')
            ->everyMinute()
            ->withoutOverlapping()
            ->evenInMaintenanceMode()
            ->sendOutputTo(storage_path() . '/queue-logs/queue-jobs.log', true);
    }
}

I setup cron job in server:

* * * * * /usr/local/bin/php /home/s***app/public_html/artisan schedule:run

I got log in \Log::info('schedule:run'); in /queue-logs/queue-jobs.log file every minutes. But command queue:work --tries=3 not work and queue stored in job table not processed.

And also my hosting provider block my every minutes request and suggest me to run this cron to 15 min instead of 1 minute



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire