-
Notifications
You must be signed in to change notification settings - Fork 405
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
[Bug]: immediately
on upsertJobScheduler
kicks in multiple times with pattern
.
#2860
Comments
immediately should be ignored for cron expressions, as it really does not make a lot of sense in that case. Does it work properly without it? |
Hey @manast
And that’s a regression bug in my honest opinion cause it indicates something is not properly calculated, time wise. |
In fact we are planing to deprecate "immediately" in the next major version of BullMQ. "every" will work as it had immediately to true all the time, as that is what users expects of every. However as cron specifies specific points in time, having an option as immediately does not make a lot of sense. If you really need it, it would be possible to implement it as a custom strategy, but it is also as simple as adding an initial job when you upsert your cron expression for the first time. |
Dear manast, I am facing the same situation as vorillaz. The We will add the necessary job manually now, but I would ask you to reconsider if this functionality might be useful for more people. Also, I just want to point out that This is a serious bug that should be fixed now, in my opinion - at least an error should be thrown when combining |
I have an issued that Job repeated every 1s instead of what i set before. Here is my implement:
These are logs:
|
Thanks for highlighting this issue, we will look into it asap. |
For the record, we may keep immediately for pattern, if this is something valuable although it is very easy to mimic by just adding a standard job. |
Version
5.21.2
Platform
NodeJS
What happened?
According to the docs the immediately option on
upsertJobScheduler
kicks in the worker instantly once registered, but once using a cron pattern along with immediately the worker starts processing multiple times in a row, from 20 to 30 times during my tests. As an additional information, according to my testslimit
option actually the kick in.How to reproduce.
Take the docs sample along with a test worker:
Once changing the
every
property to cron pattern the worker kicks in multiple times:Relevant log output
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: