Laravel 与多个调用的调度冲突

Laravel Scheduling conflicts with multiple calls

我正在使用 Laravel Task Scheduling

我需要在不同的时间运行执行多项任务,像这样:

protected function schedule(Schedule $schedule) {
    $schedule->call('App\Http\Controllers\SomeController@job1')->daily();
    $schedule->call('App\Scheduled\SomeClass@job2')->hourly();
    $schedule->call('App\Scheduled\SomeClass@job3')->hourly();
    $schedule->call('App\Scheduled\SomeOtherClass@job4')->daily();
}

但出于某种原因,所有内容 运行 每天一次(在 12:00am)。我究竟做错了什么?

听起来您的 cron 作业每天只 运行ning artisan schedule:run 一次。确保你的 cron 作业像文档一样设置:

* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1

* * * * *部分表示每分钟运行,然后Laravel将根据您的日程安排每分钟运行决定哪些任务。