My idea is:
We should bring the whole “cron jobs” thing to the next level.
Limitations so far:
- all jobs of a type run with the same frequency OR you have complex “-i” jobs which are hard to maintain
- This means that some run less frequent than desired, and some way more frequent than makes sense. No flexibility, and lots of wasted CPU cycles.
- Cron syntax is a barrier and/or cause of mistakes for many
- No transparency in the UI as to what runs when, with what frequency
- Proper error detection and alerting is tricky
Thoughts:
- Let’s have only one cron job (running once per minute), and take the rest to a Mautic-internal scheduler
- In that scheduler, allow adding console commands with frequency & hours
- Allow custom frequencies per item (like “run campaign Update for ID 16 only once per day, at 23:00 UTC”), ideally directly in the UI of that item.
- Detect & report errors (e.g. helpful log file entry)
- Make sure that an error will not block other jobs.
- Allow dependencies between jobs - e.g.
“run the campaign Trigger for each ID directly after the campaign Update for that ID has finished”
or
“after segment Update for ID 7 has finished, run campaign Update for campaigns ID 4”
or
“after segment Update for ID 7 has finished, run campaign Update for all campaigns using that segment”
etc… - Define error behavior for dependent jobs
- Introduce “Run manually” button
Obviously, this needs some pondering, so please chime in
I think these groups of people would benefit from this idea:
- Admins
Why I think they would benefit from this idea:
- overcome issues listed above
Any code or resources to support this idea:
- possible starting point? typo3/typo3/sysext/scheduler at main · TYPO3/typo3 · GitHub with TYPO3 Scheduler — Scheduler main documentation
Are you willing to work on this idea?:
- sure
What skills and resources do you need to explore this further?
- requirements
- dev
- ui