michaelklishin / quartz-mongodb

A MongoDB-based store for the Quartz scheduler. This fork strives to be as feature complete as possible. Originally by MuleSoft.
Other
249 stars 203 forks source link

Triggers are offset by one in MongoJobStore (MAJOR) #68

Closed vivganes closed 10 years ago

vivganes commented 10 years ago

What am I trying to do? I have a simple job, which prints context.getScheduledFireTime() every time it is triggered.

What error do I see? What actually happens is that, scheduledFireTimes are offset by one. (This is a time-bomb indeed!)

To explain clearly, here is a comparison of actual and expected values of scheduledFireTime.

selection_060

and so on...!

Why is this a problem with quartz-mongodb and not the Quartz Scheduler? Because,this issue happens only when using MongoDBJobStore. While using RAMJobStore, this problem does not happen.

Any more information, that might help? I compared the code, particularly triggersFired() methods, of RAMJobStore (provided default by quartz-scheduler) and MongoJobStore (provided by quartz-mongodb).

The triggersFired() method does not call

trigger.triggered(cal); 

similar to the way RAMJobStore calls it. I hope this would fix the issue.

Regards, Vivek

michaelklishin commented 10 years ago

Fixed by #69.