Replies: 2 comments 4 replies
-
Hi @sbruinsje, looks like you may need to check our step jobs patterns https://docs.bullmq.io/patterns/process-step-jobs#waiting-children |
Beta Was this translation helpful? Give feedback.
2 replies
-
Is this similar to what I'm looking for, too? #1986 |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a way to make a job kick-off child jobs dynamically, wait for those child jobs to finish and only then make the parent job finish? I know there's flows, but for what I understand with flows you define the child jobs statically. What I am looking for is way to define a job that iterates over documents in a database and create child jobs for some of those documents in another queue.
To give a bit more context:
nightly-jobs
.delete-obsolete-items
,enrich-items
, etc.enrich-items
job should run afterdelete-obsolete-items
has finished, because otherwise I might be enriching the items eventhough they will be deleted anyway (enriching them has a cost).delete-obsolete-items
job is a job that finds items that are obsolete and then deletes them. This delete operation is rather complex and they require to be executed in isolation (e.g. one at a time). I want thedelete-obsolete-items
job to kick off a seperate child job for each item to be deleted so that they can be retried individually when they fail and to make sure only one operation runs at the same time. Lets call this queueisolated-operations
.How can I make the
delete-obsolete-items
kick of child jobs in theisolated-operations
queue and wait for all child jobs to be finished before finishing itself?Beta Was this translation helpful? Give feedback.
All reactions