Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fahyik opened this issue Jan 19, 2023 · 1 comment
Open

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

fahyik opened this issue Jan 19, 2023 · 1 comment

Comments

@fahyik
Copy link

fahyik commented Jan 19, 2023

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)

@dogabudak
Copy link
Contributor

@compwright Unfortunately, I am unable to reproduce this error. After closing the queue worker stops processing new messages as expected.
@fahyik Can you maybe provide a more detailed question. Your redis version, node version etc. Might be related to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants