How to set up Laravel 5 task scheduling in Heroku?

I am trying to follow the Laravel documentation on how to do Cron jobs , and I want to add this

* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

But I do not know how to add it to Heroku.

+4
source share
2 answers

I created this scheduler, which runs once a minute and is part of your own application.

https://gist.github.com/robbydooo/65bf341ea0f4081150b945bfb1d38d3c

It creates a new type of Dyno called Scheduler, which you run.

Make sure that you run tasks in your queue so that this scheduler does not work once a minute.

Laravel 5.4+, /app/Console/Commands/RunScheduler.php app/Console/Kernel.php

protected $commands = [
Commands\RunScheduler::class
]

Procfile:

scheduler: php -d memory_limit=512M artisan schedule:cron
+4

Heroku cron scheduler, .

:

$ heroku addons:create scheduler:standard

.

+1

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


All Articles