Skip to content
New issue

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

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

Already on GitHub? # to your account

Shutdown won't always allow process to exit #450

Closed
geekytime opened this issue Oct 20, 2014 · 2 comments
Closed

Shutdown won't always allow process to exit #450

geekytime opened this issue Oct 20, 2014 · 2 comments

Comments

@geekytime
Copy link

I'm trying to make sure that I can start up and shut down kue, both for my app, but also for testing and utility purposes.

If I run the following script, kue starts up and shuts down after 3 seconds, as expected:

var kue = require("kue");

console.log("kue.createQueue");
var jobs = kue.createQueue();

//jobs.create("job").save();

setTimeout(function(){
  console.log("jobs.shutdown");
  jobs.shutdown();
}, 3000);

However, if I uncomment the line that creates the job, this script will never exit. It just runs forever until I send a kill signal, even if I extend the wait time, and process the job successfully.

I am running on Windows (although not by choice). Not sure if that would change things or not.

Am I misunderstanding the shutdown function? Shouldn't calling shutdown free up all of the listeners and allow the process to exit, even if jobs have been created or processed?

@behrad
Copy link
Collaborator

behrad commented Oct 20, 2014

add disableSearch option to your createQueue, and read #412

@geekytime
Copy link
Author

Perfect. That makes sense. I figured there was a connection getting left open, but I was digging in the wrong place!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants