Cron Job Laravel 4

I am using the liebig / cron package to work cron in my project,
I correctly completed the installation process of this package,
And here is my code

Route::get('/cron/run/cronjob123', function () {
Cron::add('example1', '* * * * *', function() {
                    echo 'success'; die;
                    return null;
                });
$report = Cron::run();
});

Now I work in localhost, so when I enter the url myproject / cron / run / cronjob123 It should display success
But the execution flow will be $ report directly
And this report has this result,

Array ( [rundate] => 1398489241 [runtime] => -1 )

I do not understand where I am mistaken.

+4
source share
1 answer

liebig/cron 'preventOverlapping' => true . cron, (.. ).

cron, cron.lock app/storage. - cron, cron.

/. cron.lock, cron.

, .

+3

Source: https://habr.com/ru/post/1538163/


All Articles