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
Question: Repeatable jobs are not executed at all #1259
Comments
Hi @ff6347, you may need a queueScheduler instance https://docs.bullmq.io/guide/queuescheduler |
Hi @roggervalf Thanks for your reply. I saw that as well, added it in my code but still the queue is not executing. There is some thing happening in Redis but I can't say what (since it is my first day with bullmq). I updated my code above to reflect what I did. |
hey @ff6347 in your example, you should import QueueScheduler as well, prefix should be passed into queueScheduler options as you did with worker and scheduleQueue, also in queueEvents is missing the prefix |
Hi @roggervalf thank you for your support. The imports where there, I just missed them when copying the code. Can I ask one last design related question? I'm working on a tool where I need to add jobs to a queue dynamically. The scheduled worker collects data from a database and creates n new jobs based on what he found. He will have a return value. Where would be the best location to add new jobs to a second queue?
My choice would be in the workers on completed callback. But maybe I'm wrong? |
The best place is in 1. in the handler of my schedule worker. |
Because if that handler completes you get the guarantee that the next job is in the queue, and if it fails you can fix it, retry it, etc. |
@manast thank you. I thought that it would be good to only add the jobs if the worker completes without an error. If the last thing the worker does is doing the DB request and returning the result. What could go wrong after that? That why my choice was 2. (workers on completed). Anyway thank you a lot for your support and your work on this (and I'm sure other) oss project |
Well, Redis could be down and then the job will not be marked as completed. Choice 2 will work as long as all services are online at all times, but eventually, it will fail. |
Hi I'm a first time bullmq user and I'm a bit puzzled why I'm not seeing any output from my queues repeatable jobs. This only happens for repeatable jobs, if I remove the repeat section in the options the job runs.
The setup is pretty simple (mostly taken from the docs). I don't get any logging from the handler function in the worker, nor from the emitted events of the worker, nor from the queueEvents.
Can anyone point me to my misconceptions?
This is queue/index.ts
this is index.ts
The text was updated successfully, but these errors were encountered: