Skip to content

Calling queue.stop() does not stop the workers #584

@fahyik

Description

@fahyik
const publisherQueue =   new BeeQueue(queueName, 
      isWorker: false,
      redis,
      activateDelayedJobs: true,
    });

const consumerQueue = new BeeQueue(queueName, {
    isWorker: true,
    redis,
    removeOnSuccess: true,
  });

 consumerQueue.process(3, async (job) => {
      logger.debug('Job starting', {
        jobId: job.id,
        jobData: job.data,
        queueName: queue.name,
      });
    });
  
// on receiving SIGTERM, i run
await consumerQueue.close(TIMEOUT) // TIMEOUT set to 90 secs

I have a simple set up as above.
It seems that the .close has zero impact on my workers, as they continue running. (I know this as my workers continue logging after the .close() call)
On every shutdown i basically get a error from bee-queue saying :"Operation timed out."

Is there something wrong with my set up? or is there an issue with .close() ?
(i couldnt find anything obvious in the source code)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions