NestJS queues with more than one job

1.4k Views Asked by At

I have an issue with NestJS and Bull MQ, whenever I try to process more than one job only the very first one gets executed but not the rest.

I go through emails then start processing them like this. only the first one is added to the queue, not the rest.

for (let i = 0; i < mails.length; i++) {
  const mail = mails[i];
  await this.metricsQueue.add(
    'metricsImport',
    {
      date: mail.subject.split(';')[2],
      locationId: Number(mail.subject.split(';')[1]),
      sender: mail.sender,
    },
    { jobId: mail.mailId },
  );
}
0

There are 0 best solutions below