Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

New triggers inserted, rather than updated #27

Closed
chrismyang opened this issue Jun 29, 2013 · 0 comments
Closed

New triggers inserted, rather than updated #27

chrismyang opened this issue Jun 29, 2013 · 0 comments

Comments

@chrismyang
Copy link
Contributor

I'm running into an issue where, every time the trigger is updated and then persisted, a new copy of that trigger is inserted, rather than updating – so every time the main event runs, I get a new copy of all my triggers. This looks like it might be related to Issue #17 though not sure.

According to RamJobStore#storeTrigger, it looks like triggers get updated (or replaced rather), but I'm no expert on Quartz so forgive me if my understanding of the semantics is wrong.

If this is truly incorrect behavior, it looks like it's caused by two things:

  1. the index you add to the trigger collection includes nextFireTime and previousFireTime (https://github.com/michaelklishin/quartz-mongodb/blob/v1.2.0/src/main/java/com/novemberain/quartz/mongodb/MongoDBJobStore.java#L858)...
  2. ...which would be fine except that you rely on the uniqueness of that index to detect when an update should occur (https://github.com/michaelklishin/quartz-mongodb/blob/v1.2.0/src/main/java/com/novemberain/quartz/mongodb/MongoDBJobStore.java#L895)

Happy to submit a pull request if you can verify that what I'm saying makes sense - although it's such a small fix might be easier and safer for you to do yourself.

Thanks!

michaelklishin pushed a commit that referenced this issue Jun 29, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant