taskforcesh / bullmq-pro-support

Support repository for BullMQ Pro edition.
1 stars 0 forks source link

worker.close hangs when using limiter #56

Closed sakari closed 1 year ago

sakari commented 1 year ago

with bullmq-pro-6.3.2 worker.close hangs (or at least takes a long time) when using rate limiting and not forcing

      const queueName = 'some queue';
      const queue = new QueuePro(queueName, { connection: redisConnectionConfiguration });
      const limiter = { max: 1, duration: 60 * 1000 };
      const worker = new WorkerPro(queueName, async () => {}, { connection: redisConnectionConfiguration, limiter });
      await queue.add(anyString(), 1);
      await promisify(setTimeout)(1000);
      await worker.close();

with worker.close(true) we do not hang but I would like to allow the currently processed job to finish.

manast commented 1 year ago

But is it that the Worker is still working on some job and that's why it takes so long time?

sakari commented 1 year ago

async () => {}

is the worker body. That should not take many moons to go through 😁

manast commented 1 year ago

ah sorry didn't see the code 😂

manast commented 1 year ago

I have been able to reproduce it and it seems to be present in BullMQ as well. Debugging it now...

manast commented 1 year ago

The issue should be fixed now in Pro version v6.3.4.