Replies: 1 comment
-
For now this is the best answer I can give (ChatGPT): To update the recurrence of a repeatable job in BullMQ, you essentially have two main approaches: removing the old repeatable job and creating a new one with the updated recurrence pattern, or directly updating the repeatable job if you're managing your jobs at a more granular level through Redis. Approach 1: Remove and Add a New JobThis is the most straightforward approach. First, you need to remove the existing repeatable job and then add a new job with the updated recurrence pattern. Here's how you can do it:
Approach 2: Direct Redis Manipulation (Advanced)For advanced users who are comfortable manipulating Redis directly, you can update the job's recurrence directly in Redis. This approach is more complex and requires a good understanding of how BullMQ stores repeatable jobs in Redis. It's not recommended unless you have specific needs that the BullMQ API cannot accommodate. Best Practices
For most use cases, the first approach (remove and add) is recommended for its simplicity and direct support through the BullMQ API. Direct Redis manipulation should be reserved for exceptional cases due to its complexity and the potential for unintended side effects. |
Beta Was this translation helpful? Give feedback.
-
I've read the docs and understand that under the hood repeatable jobs are just delayed jobs. I also see its possible to update the delay of a delayed job while its in the delayed state. Therefore is it possible to update the recurrence of a repeatable job? It doesn't explicitly mention this in the docs.
Beta Was this translation helpful? Give feedback.
All reactions