Last active
December 14, 2017 03:33
-
-
Save idealhack/98bb6e3f0a5e71b39a77 to your computer and use it in GitHub Desktop.
Reset active kue jobs to inactive state
This file contains 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 redis = require ('redis'), | |
kue = require ('kue'), | |
redisClient = redis.createClient(6379, "127.0.0.1"); | |
kue.redis.createClient = function () { | |
return redisClient; | |
}; | |
kue.app.listen(7000); | |
kue.Job.rangeByType ('notification', 'active', 0, 10, 'asc', function (err, selectedJobs) { | |
console.log(selectedJobs) | |
selectedJobs.forEach(function (job) { | |
job.state('inactive').save(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment