-
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
How to query all the active jobs programatically? #418
Labels
Milestone
Comments
Something like this: jobs.active( function( err, ids ) {
ids.forEach( function( id ) {
Job.get( id, function( err, job ) {
job.inactive();
}
}
}); |
Yes. Got it Thanks a lot. var kue = require('kue');
var jobs = kue.createQueue({
prefix: 'kue',
redis: {
port: options.port,
host: options.host,
auth: options.password
}
});
// Restart the server , change all active job into active
jobs.active( function( err, ids ) {
ids.forEach( function( id ) {
kue.Job.get( id, function( err, job ) {
job.inactive();
});
});
}); It should be like that. |
@kithokit Please remember to put your codes in related github markups, I did it for you this time ;) |
Ok. Thanks a lot! |
Thanks @behrad! |
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have stuck all the jobs in active state due to app crash.
How can we query all the active job in Kue and change back to inactive state programmicatlly?
Thanks a lot
Kit
The text was updated successfully, but these errors were encountered: