Closed perlDreamer closed 2 weeks ago
What if the management for cron jobs was handled by ving itself.
When you try to enqueue a cron job, what you are really doing is writing to a database table in ving (not TGCv).
There would then be a job handler called RepeatRunner that would be installed into BullMQ to run on the set schedule. Each time it executes, it would look at the ving table for repeatable jobs and run each of the jobs associated with that schedule.
That sounds pretty reasonable and is better than anything else I've though of so far. There's just fine details to consider though, like removing the RepeatRunner with a certain cron spec when the last job with that spec is removed from the table, and making sure that one failing job never prevents other from running, etc.
Added Cron Jobs subsystem.
https://docs.bullmq.io/guide/jobs/repeatable
Steps to repeat.
1) Disable all job handlers. 2) Add cron jobs
I'd expect to see 3 jobs for Test, two that run at the same time and another a different time, but this only makes 2 jobs. I think this is because the Redis key name is probably identical between the two different cron specs.
This is affecting the Hardware Schedules, because there may be a lot of different equipment with jobs that are all done on the 1st day of the month, end of the week, etc.