I'm running the scheduler in kubernetes as a deployment with supercronic. The scheduler runs and I can see the below from the logs
starting flarum scheduler via supercronic
time="2024-01-24T18:22:52-05:00" level=info msg="read crontab: /scheduler.cron"
time="2024-01-24T18:23:00-05:00" level=info msg=starting iteration=0 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:23:00-05:00" level=info msg="job succeeded" iteration=0 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:24:00-05:00" level=info msg=starting iteration=1 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:24:00-05:00" level=info msg="job succeeded" iteration=1 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:25:00-05:00" level=info msg=starting iteration=2 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:25:00-05:00" level=info msg="job succeeded" iteration=2 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:26:00-05:00" level=info msg=starting iteration=3 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * * *"
time="2024-01-24T18:26:00-05:00" level=info msg="job succeeded" iteration=3 job.command="php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1" job.position=0 job.schedule="*/1 * * *
While my draft scheduled date passes in the above and the draft remains scheduled. I do have the timezone set in the container, the timestamp of the logs matches my local timezone -05:00 and date I scheduled the post for. In the database, the UTC time is stored. Perhaps something wrong with my TZ settings or something else?
This is my first time using the scheduler, previously I just relied on the Queue driver which ran similarly in a container via supercronic. The admin panel shows the scheduler was never run, and the queue shows inactive and is also not triggering.
https://discuss.flarum.org/d/24118-setup-the-flarum-scheduler-using-cron
Is it important to actually change the working directory before executing the flarum schedule:run
command? Thats the only difference I could really spot.
*/1 * * * * php /usr/share/nginx/flarum schedule:run >> /dev/null 2>&1
Edit: Yes that was it! setting the working directory to where flarum is apparently is required. I know that's what the instructions show for the scheduler setup, but it looks cleaner calling the full path directly in a single command and I didn't think it'd matter 😉