Laravel Scheduler不运行工匠司令部

发布于 2025-01-23 05:26:03 字数 406 浏览 3 评论 0原文

我写了一个自定义工匠命令(“获取应用程序的指标”),并将其添加到我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

苍白女子 2025-01-30 05:26:03

在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

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文