Scheduling tasks in MODX
Run resource intensive processes in the background.
How to set it up
Start by installing Scheduler via package management (ModMore provider).
Configure it to run every minute, via cron job:
crontab -e
Then add the following line at the bottom:
* * * * * php -q /var/www/romanesco/nursery/assets/components/scheduler/run.php
That's it! Now you can add resource intensive tasks like generating critical CSS to the Scheduler queue.
Adjusting tasks per run
By default, Scheduler will only run 1 task every minute (I think). You can tweak this by adding a system setting scheduler.tasks_per_run
with a different value. Multiple tasks will be triggered on each run then.