jikan-me / jikan-rest

The REST API for Jikan
https://docs.api.jikan.moe/
MIT License
413 stars 268 forks source link

🐛 php artisan schedule:run does not run any commands #445

Closed Manj0tBenipal closed 8 months ago

Manj0tBenipal commented 9 months ago

Is there an existing issue for this?

Current Behavior

When I run php artisan schedule:run, it gives a message saying "INFO: No commands are ready to run" Moreover the link to which documentation refers to modify the scheduler.seems to be directing to a different version of API as the location of Kernel.php is /app/console, not /app/console/commands as referred by documentation.

Expected Behavior

It should be running indexer for anime-shedule, common and genres etc

Steps To Reproduce

Run:

php artisan schedule:run

Environment

Ubuntu 22 LTS
API version 4

Anything else?

No response

pushrbx commented 8 months ago

That's not how it works. php artisan schedule:run only runs things if they should be ran at the minute point your are running php artisan schedule:run command.

E.g. you have a schedule like this:

protected function schedule(Schedule $schedule)
{
    $schedule
        -> command('cbh:dummyCommand')
        -> everyFiveMinutes()
        -> appendOutputTo ('/my/logs/laravel_output.log');
}

If you run the command: php artisan schedule:run at 11:04, then the response is:

# No scheduled commands are ready to run.

But if you run the same command at 11:00 or 11:05, then you get:

# Running scheduled command: php artisan cbh:dummyCommand >> /my/logs/laravel_output.log 2>&1

So it's better to run php artisan schedule:run on cron with the following rule:

*/1 * * * * php /app/artisan schedule:run

Also it doesn't do any "catchups" for missed executions.