Laravel Scheduler不运行工匠司令部
我写了一个自定义工匠命令(“获取应用程序的指标”),并将其添加到我的Forge托管网站上的内核中,以使用Laravel的出色调度程序功能每晚运行它。
class Kernel extends ConsoleKernel
{
protected $commands = [
Commands\GetAppsMetricsForDay::class
];
protected function schedule(Schedule $schedule)
{
$schedule->command('get:metrics')->daily();
}
除了它不会每天晚上运行。我可以在命令行上运行它 - 命令很好。 Forge的日志文件中没有错误。怎么了?
I wrote a custom artisan command ("get App's Metrics") and added it to the Kernel on my Forge-hosted site to used Laravel's awesome scheduler feature to run it every night.
class Kernel extends ConsoleKernel
{
protected $commands = [
Commands\GetAppsMetricsForDay::class
];
protected function schedule(Schedule $schedule)
{
$schedule->command('get:metrics')->daily();
}
Except it doesn't run every night. I can run it on the command line - the command is good. There are no errors in Forge's log file. What's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Forge上,您需要从网站的控制面板“返回一个级别”到服务器的控制面板,并创建时间表:运行命令,该命令将运行您添加到应用程序的任何命令
On Forge, you need to "go back up one level" from you site's control panel to your server's control panel, and create the schedule:run command that will run any commands you add to your application