使用Laravel,我想每3个月创建一个作业队列 !所以我想检查一下。
$schedule->command('emails:send')->monthly()->monthly()->monthly()->when(function () {
return true;
});
我可以像上面那样写吗?
三次使用monthly()
是行不通的。
你必须使用crontab语法让一个作业'每三个月'运行一次
类似:
$schedule->command('emails:send')->cron('* * * */3');
使用在线工具(如cronmaker)仔细检查crontab条目