Open dawnerd opened 9 years ago
Syncing scares me.
Yeah. I'm not sure if it's really needed. Agenda checks the db every x seconds which kind of acts like a sync. Here the db is only checked when a job is run.
I think the current server should get job from db on run and see if anything has changed before actually running
That's a good idea, and wouldn't be that hard to implement since the db is already hit when a job runs to make sure it's not locked.
If running on multiple servers it's possible that the job list can get out of sync if calls to enable/disable/reschedule are made. Could use an option to sync up the db every x minutes, or maybe sync on job runs?
Workaround right now is to call getJobs which pulls from the db and modify the local jobs array to match.