How to stop jobs getting processed twice in bull?

30 Views Asked by At
const Queue = require('bull')

const myFirstQueue = new Queue('my-first-queue');

myFirstQueue.process(async (job, done) => {
  await doSomething(job.data);
  done();
});

I have two kubernetes pods with the above code running.In rare cases, results in same job getting process twice.

As per Bull documentation (https://github.com/OptimalBits/bull/blob/HEAD/REFERENCE.md#queueprocess), it promises atleast once processing. Setting 0 as concurrency means utmost once? Also, How does setting 100 as concurrency work under the hood?

0

There are 0 best solutions below