【问题标题】:Laravel Cron liebig/cron?Laravel Cron 里大/cron?
【发布时间】:2015-03-21 13:37:26
【问题描述】:

当我使用 laravel cron api "liebig/cron"

Route::get('/cron/run/c68pd2s4e363221a3064e8807rrt342', function () {

    Cron::add('example1', '* * * * *', function() {

                     $test = new Test();
                     $test->name='aaa';
                     $test->save();
                    });
    $report = Cron::run();
    print_r($report);
});

输出:Array ( [rundate] => 1400059503 [runtime] => -1 ) =>当我转到 url 路径“/cron/run/c68pd2s4e363221a3064e8807rrt342”时,这会告诉我

这是错误还是什么?

如何在 Windows 中测试它?

谢谢

【问题讨论】:

    标签: php laravel cron


    【解决方案1】:

    运行时值 -1 表示您有一个 cron 作业已经在运行。 因此,如果您想同时再次运行相同的 cron 作业,则需要将 preventoverlapping 的值更改为 false。以便它可以再次运行。

    您也可以通过命令提示符进行测试,也可以使用 artisan 命令 工匠 cron:运行

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-04-08
      • 2018-02-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-09
      • 2021-12-17
      • 2014-12-15
      相关资源
      最近更新 更多