Created
September 11, 2014 15:49
-
-
Save ericsaboia/33b814705b6dc0e87972 to your computer and use it in GitHub Desktop.
Reactivate kue jobs passing a type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var kue = require('kue'); | |
var jobs = kue.createQueue(); | |
console.log('Restarting job ' + process.argv[2]); | |
jobs.state(process.argv[2], function (err, ids) { | |
ids.forEach(reactivate); | |
}); | |
function reactivate (id) { | |
kue.Job.get(id, function(err, job) { | |
console.log(id); | |
job.inactive(); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't forget to pass on the config object in createQueue() if you have one.