Laravel Cronjobs
- Lingua principale
- HTML
- Stelle
- 1k
- Fork
- 25
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Would you consider an update to the documentation for managing cronjobs for Laravel installs?
This is based on my existing setup and the advice from the Laravel documentation.
Laravel's command scheduler allows you to fluently define your command schedule within your Laravel application itself and not within the cron entry itself.
I setup a single cronjob on the server that hits the scheduler every minute.
`* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1`
In its most very basic form I will implement the schedule method on `App\Console\Kernel`, and schedule the commands to execute and and how often to repeat.
For eg.
The following command has a list of jobs that needs to be executed "every minute".
```
* * * * * php /path/to/artisan aimeos:jobs "order/export/csv order/email/delivery order/email/payment order/email/voucher order/service/delivery subscription/export/csv customer/email/account"
```
We can replace this with the schedule command which can be committed and managed through the repository.
```php
protected function schedule(Schedule $schedule)
{
$schedule->command($this->buildCommand('aimeos:jobs', [
'order/export/csv',
'order/email/delivery',
...
'customer/email/account'
]))->everyMinute();
}
```
Similarly, those jobs that need to run every hour...
```php
protected function schedule(Schedule $schedule)
{
$schedule->command($this->buildCommand('aimeos:jobs', [
'customer/email/watch',
...
'order/service/payment',
]))->hourly();
}
```
There may be a reason why you haven't taken this approach that im unaware off, only I did notice that the TYPO3 is managed differently to Symphony and Laravel setups so its not necessarily for consistency across the supported platforms.
If you are happy with the suggestion I can fork the repo and create a pull request with my amendments?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Valutazione
Questa issue non è ancora stata valutata.