feat: remove job on complete and failed

This commit is contained in:
Nevo David 2024-08-09 22:01:39 +07:00
parent f51b2b500a
commit e130717951
2 changed files with 3 additions and 2 deletions

View File

@ -58,6 +58,8 @@ export class BullMqClient extends ClientProxy {
queue
.add(packet.pattern, packet.data, {
jobId: packet.data.id ?? v4(),
removeOnComplete: true,
removeOnFail: true,
...packet.data.options,
})
.then(async (job) => {

View File

@ -46,10 +46,9 @@ export class BullMqServer extends Server implements CustomTransportStrategy {
});
});
},
// @ts-ignore
{
...this.options,
...{ removeOnComplete: true, removeOnFail: true },
...{ removeOnComplete: { count: 0 }, removeOnFail: { count: 0 } },
...handler?.extras,
}
);