-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Calling Promote on Job does not check if Queue is Ready #1231
Labels
Comments
Do we have a PR for this? |
chocof
pushed a commit
to chocof/bull
that referenced
this issue
Jan 19, 2020
hello, I just created a pr for this #1619 :) |
Until a new version is cut, I fixed this for my code by doing: const job = // ...get job
await job.queue.isReady();
await job.promote(); |
jtassin
pushed a commit
to jtassin/bull
that referenced
this issue
Jul 3, 2020
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
duyenddd
added a commit
to duyenddd/bull
that referenced
this issue
Jul 28, 2024
bestalternativereviews1
added a commit
to bestalternativereviews1/bull
that referenced
this issue
Aug 13, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
When we create delayed jobs in a queue from a producer application and try to promote them from a consumer application then we get an error.
Scenario
The first script produces some delayed jobs
This script reads and promotes them to be executed
Result
Cause
After looking into the code I believe that the problem here is that the queue has not yet
been properly initialised when we are trying to access the promote function.
To fix this issue I added the following code to job.promote function lib/job.js:280
If you want me to, I can upload a PR to fix the issue.
However if this is the expected behaviour or if I am doing something wrong then please
let me know :)
Bull version
3.7.0
Additional information
The issue happens only when the consumer side is just initialised (due to the queue not being initialised).
The text was updated successfully, but these errors were encountered: