-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: Avoid double updating on the non-recurring jobs vs recurring jobs search in resumeOnRestart #63
fix: Avoid double updating on the non-recurring jobs vs recurring jobs search in resumeOnRestart #63
Conversation
…rch in resumeOnRestart
@code-xhyun see if my question is relevant. Thank you |
@code-xhyun I think this should be merged in the same 1.6.4 if possible (if not in .5) so we avoid redundant double updates. But let me know what you think. Thanks a lot. |
@b0dea Hmm... Regarding your question, I think it would be good to add that part. However, since I haven't been paying much attention to this lately, there might be some cases I missed. Currently, version 1.6.4 has already been released. This should be included in the 1.6.5 release. |
@b0dea And make sure to standardize the commit conventions! |
On this note @code-xhyun - is Pulse going to keep being maintained in the long run? I have been using this in one of my projects since moving to MongoDB's latest drive and I just want to make sure it's ok to keep using it as a long-term solution. Thank you Also, let's leave for now the check of |
I added some more checks on resumeOnRestart + comment on each case so we know what we do there. From my POV, this PR is ready to be merged whenever you have time also to get a good look on all changes and see if anything else to be added. Thank you @code-xhyun. |
@b0dea |
@b0dea |
@code-xhyun just discovered into my project, after updating to 1.6.4 that there is an issue (I guess it's out of the changes I made - even if unit tests are passing (added more now) with I have a recurrent job that's planned to be run each 10 minutes, Can you quickly look also, please? Otherise 1.6.4 might be buggy, even if the unit tests I added are passing. Thank you |
Thanks for the trust. I am happy to help where I can. However, I am also the founder of a startup - so my coding time is limited. |
@b0dea For now, I have invited you as a maintainer. Currently, I’m out of the office for company work and unable to review the code |
Ok. Thank you. Do take a look also when you have time. I am going to look also and let you know (will push in this PR) if I find the root of it. |
@code-xhyun ok so the issue is surely under ther default value on |
🎉 This PR is included in version 1.6.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Unfortunately, as many unit tests I am doing (and all are passing), in my system when I use the new plugin - due to some reason (and now if we look at changes, only resumeOnRestart is changed basically), nextRunAt is still null. Please look also, no need to code, just let me know what you think we should change. |
This is related to my PR created and merged here: #62. See also the question below.
I have realised that in
resumeOnRestart
, the firstupdateMany
might update both recurring and non-recurring jobs, and then the second one will update non-recurring jobs again. Now, I have split the search completely by adding a strong check when searching non-recurring jobs.As a separate question @code-xhyun
{ $expr: { $eq: ['$runCount', '$finishedCount'] } }
in the second part of the non-recurrent query search (where we search for not locked and not finished non-recurrent jobs)? As in, to check if runCount is same as finishedCount but there is nolastFinishedAt
set for example.Please take an overall look, I might have missed some other cases.
Thank you.