-
Notifications
You must be signed in to change notification settings - Fork 867
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
Queue with active job shutdown problem #406
Comments
which kue version are you using? |
i have kue@0.8.6, but i didn`t have disableSearch: true in queue options
but it doesn`t help, still have infinite project run |
I'd tested that, send me your code. |
hi, there are the files code: kue_test1.js:
and kue_test2.js:
after run i have next output
|
You should call done before @slyder jobs.process('test_job', function(job, done) {
console.log('recieved new job: ' + job.id);
done();
jobs.shutdown(function(err) {
console.log('closing, error: ', err);
}, 3000);
}); |
Tryed it just now, but it doesn't help:
and when i do not call done('MY SHUTDOWN'); looks like kue call done('SHUTDOWN') also, because i could see job in failed list... |
Only the code I wrote for you was working (i.e. when calling
which I fixed and will provide you a patch just now. Thank you @slyder for reporting this 👍 |
Behrad, hello, i have next common situation:
var jobReciever = new JobReciever({
redis: config.redis,
jobName: 'job_name',
});
contstructor just connects to redis and creates Kue queue assigned to this.job , then i have next code:
jobReciever.jobs.process('job_name', function(job, done) {
console.log(job.data);
jobReciever.jobs.shutdown(function(err) {
console.log('closing, error: ', err);
}, 3000);
});
and after that node does not close aplication process, so i have to press CTRL+C to stop application.
I see what you have process.exit(0) in shutdown callback, but i need to have other code after queue.shutdown.... is there any way make queue.shutdown while current job is active?
The text was updated successfully, but these errors were encountered: