[Bug]: JobPro doesn't have removeUnprocessedChildren, regular Job does
Version
v5.49.1
Platform
NodeJS
What happened?
Running BullMQ Pro 7.32.2 atop BullMQ 5.49.1.
I'm building a "replace all related jobs" feature allowing my API consumer to replace all upcoming jobs under a given parent jobId. Naturally this means removing all children, then re-adding new children.
Strangely it seems like <job>.removeUnprocessedChildren() exists on a Job but not a JobPro. On a JobPro there's no such method.
Incidentally I tried doing this with deduplication and that didn't seem to work with flow parents at all. But here at least the general functionality is there - just not with Pro.
If there's a better way to build the above functionality I'm all ears but either way this seems like a bug.
How to reproduce.
const { QueuePro } = require("@taskforcesh/bullmq-pro");
const { FlowProducerPro } = require('@taskforcesh/bullmq-pro');
const flowProducer = new FlowProducerPro({
connection
});
const queue = new QueuePro('Paint', {
connection
});
flowProducer.add({
name: 'renovate-interior',
queueName: 'Paint',
data: {
dataSubject: "[email protected]"
},
opts: {
jobId : "[email protected]"
},
children: [
{ name: 'paint', data: { place: 'ceiling' }, queueName: 'Paint' },
{ name: 'paint', data: { place: 'walls' }, queueName: 'Paint' },
{ name: 'fix', data: { place: 'floor' }, queueName: 'Paint' },
]
})
.then( flowResp => {
console.log(typeof flowResp.job.removeUnprocessedChildren);
})
Relevant log output
undefined
Code of Conduct
- [x] I agree to follow this project's Code of Conduct
thanks for reporting this, we are looking into it, it could just be that the typings are incorrect, but the method should be there.
Do you have an ETA for getting this in Pro? It looks like I can do without the Pro features (i.e. Groups) for now if need be but also wanted to use -Pro variants everywhere.
We have a PR open for this but there is some small work to do before it is ready. Luckily tomorrow, or on Monday.
OK that would be cool
For the record, the reason this method is not available is because Pro always is delayed a few versions from latest BullMQ, unless we have done some critical fixes.