在laravel(octobercms)中运行多个时间表

问题描述 投票:-1回答:1

我有这些时间表要执行

public function registerSchedule($schedule)
{
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostMsb')
           ->everyMinute();
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostMbb')
           ->cron('0 */12 * * *');
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostMeb')
           ->cron('0 */6 * * *');
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostBmsb')
           ->daily();
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostBmbb')
           ->cron('0 */12 * * *');
  $schedule->call('Corymillz\Adverts\Component\PaidBoost@onPaidBoostBmeb')
           ->cron('0 */6 * * *');
}

我跑步时

php artisan schedule:run

似乎只执行第一个时间表,因为它显示了

正在运行的计划命令:Corymillz \ Adverts \ Component \ PaidBoost @ onPaidBoostMsb

我在本地主机上,这是它在本地主机上运行的方式吗?还是我安排的任务安排有误?

php laravel octobercms
1个回答
0
投票

您可以运行多个计划。它从来不限于一个。

当您运行php artisan schedule:run时,不满足其他运行时间表的条件。

cron任务php artisan schedule:run应该按照Laravel的建议每分钟运行。

© www.soinside.com 2019 - 2024. All rights reserved.