Closed matthiaz closed 1 year ago
From Slack
schedule-worker:
size: S
commands:
start: |
php artisan schedule:work
Unfortunately workers only work starting from the Medium plan, which is too much for many projects. The alternative for smaller projects it to use a native cronjob instead of the Laravel scheduler. Might be good to add this in the docs and / or comment inside the yaml
template.
Intro
app/Console/Kernel.php
has a simple:Expected result
Log result when you happen to deploy it on minute 00 05 10 15 20 25 30 35 40 45 50 55
Actual failed result However, if you deploy it on any other minute: (or we do a maintenance and move it... )
Notice the distinct lack of running the actual scheduled command. This is because Laravel currently assumes that we run a cron every minute, and it therefore assumes that it will encounter 00 05 10 15 ... at some point. (which it doesn't)
Proposal to solve
Make a service provider that overrides the CronExpression and injects our own, that can deal with the shift of minutes.