Lumen 5.8 Планирование задач - PullRequest
0 голосов
/ 06 февраля 2020

Я добавил задание в очередь в Планирование задач в люмене 5.8 следующим образом,

Использовал драйвер очереди базы данных

Кажется, проблема в том, что функция handle () не вызывает функцию

class Kernel extends ConsoleKernel

{

/**
 * The Artisan commands provided by your application.
 *
 * @var array
 */
protected $commands = [
    //
];

/**
 * Define the application's command schedule.
 *
 * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
 * @return void
 */
protected function schedule(Schedule $schedule)
{
    $curl = new \Ixudra\Curl\Facades\Curl();
$schedule->job(new SyncByFiveMinutesUpdatedTicketsJob(true, $curl, 2, null))->everyFiveMinutes();
    $schedule->job(new SyncAllAgentsJob(true, $curl, null))->daily();
    $schedule->job(new SyncSlaPolicesJob(true, $curl, null))->twiceDaily(1, 13);
    echo "worked ".date("Y-m-d H:i:s")."\n";
}

}

Вот класс работы

/ * * Класс работы * /

class SyncByFiveMinutesUpdatedTicketsJob extends Job {

use InteractsWithQueue, Queueable, SerializesModels;

/**
 * Create a new job instance.
 *
 * @return void
 */
protected $sync_tickets;
protected $curl;
protected $initiate;
protected $next_url;
protected $type;

                            //true, $curl, null, 2
public function __construct($initiate,Curl $curl, $next_url, $type)
{

    if($initiate){
        $this->initiate = true;
    }
    else{
        $this->initiate = false;
    }

    if($next_url){
        $this->next_url = $next_url;
    }
    else{
        $this->next_url = null;
    }

    if($curl){
        $this->curl = $curl;
    }

    if($type){
        $this->type = $type;
    }
    echo "five minutes --- 1.1 ";
}

/**
 * Execute the job.
 *
 * @return void
 */
public function handle()
{
    new SyncAllTickets($this->initiate,$this->curl ,$this->type, $this->next_url);
}

} ​​

Я создал команду и попытался запустить команду из очереди

Не работает какая-либо помощь?

...