-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Duplicated Events #14
Comments
Hi @darkterra, do you have any idea on how we should fix this, I can help but maybe this is a big change. |
Hello @dfliess, There is no error in the operation of the Mongo Scheduler More module. By default, MSM queries the database every 60 sec (60000 mili sec) to see if there are any events to trigger. This condition "cron": * 41 18 * * 3 So with the default conf and your condition "cron" you have ~ 59 chances out of 60 to have two times a trigger of the same event. If you change the By cons, if you add to your condition "cron" the seconds, ex: 0 41 18 * * 3 FYI, I invite you to see more about cron and module cron-parser. |
HI @darkterra you are right, that's a good way to fix my issue. thanks! |
Hi @darkterra
I found that some cron event's are being fired twice.
I think that the issue is here:
mongo-scheduler/lib/scheduler.js
Line 108 in 04dfb87
You are rescheduling in the next second and maybe the parser.next may return that it's the same minute. Not sure the best way to solve it but maybe you can pass the parser currentDate as the next time you will poll ...but should think better what can happen with expressions that repeat by seconds.
Here you have an example that reproduce this:
This was the output after waiting for 2 minutes or 2 polls
The text was updated successfully, but these errors were encountered: