A
A
Andrey Gotsulyak2018-02-16 18:56:23
Task Schedulers
Andrey Gotsulyak, 2018-02-16 18:56:23

How to set up Laravel task scheduler?

Hello, the question is the following. I need to make a Cron task, for this I wrote my own command, tested everything works. Next I created a task in app/Console/Kernel.php :

protected function schedule(Schedule $schedule)
    {

        Log:info("Запуск!");

        $schedule->command('tlgrm:start')->everyMinute();

        $schedule->call(function () {
            Log:info("Работает!");
        })->cron('* * * * * *');
    }

And then the most interesting thing, it enters the function schedule (I check it with a log), but neither the command nor $schedule->call is executed, I have already tried different options but to no avail, it still does not work.
Another point when executing in the php7.1 console artisan schedule:run issues No scheduled commands are ready to run.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Aksentiev, 2018-02-16
@Sanasol

Is there a task to launch in cron or what?
https://laravel.com/docs/5.6/scheduling#introduction

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question