我试图在 laravel 任务调度中链式运行三个作业,kernel.php
但它只执行第一个作业而忽略其他两个作业。
kernel.php
protected function schedule(Schedule $schedule)
{
// $schedule->job(new \App\Jobs\FetchEmailAttachment)->everyMinute();
// $schedule->job(new \App\Jobs\SplitAttachment)->everyMinute();
// $schedule->job(new \App\Jobs\ResendAttachment)->everyMinute();
$schedule->job((new \App\Jobs\FetchEmailAttachment)->chain([
new \App\Jobs\SplitAttachment,
new \App\Jobs\ResendAttachment
]), 'mailbox')->everyMinute();
}
我想一一运行链中的所有作业。