当我使用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);
});输出:当我转到url路径“/cron/ =>this /c68pd2s4e363221a3064e8807rrt342”时,Array ( [rundate] => 1400059503 [runtime] => -1 ) run显示我。
这是错误还是什么?
如何在windows中测试它?
谢谢
发布于 2015-03-21 13:37:26
运行时值-1表示您已经有一个cron作业在运行。因此,如果你想在同一时间再次运行同样的cron作业,那么你需要将preventoverlapping的值更改为false。这样它就可以再次运行。
您也可以通过命令提示符使用artisan命令artisan cron:run来测试它
https://stackoverflow.com/questions/23651417
复制相似问题