Skip to content

Instantly share code, notes, and snippets.

@Bersam
Last active October 5, 2016 07:08
Show Gist options
  • Save Bersam/c46148decf0acf4b8544a66f13f11bcd to your computer and use it in GitHub Desktop.
Save Bersam/c46148decf0acf4b8544a66f13f11bcd to your computer and use it in GitHub Desktop.
var clean = function(self){
return self.pause()
.then(function() {
log.info(self.data.username + " is paused.");
self.toFollow.on('cleaned', function(job, type) {
console.log('Cleaned %s %s jobs', job.length, type);
});
return self.toFollow.clean(0, 'completed');
})
.then(function() {
self.toUnfollow.on('cleaned', function(job, type) {
console.log('Cleaned %s %s jobs', job.length, type);
});
return self.toUnfollow.clean(0, 'completed');
})
.then(function() {
self.toSeekQ.on('cleaned', function(job, type) {
console.log('Cleaned %s %s jobs', job.length, type);
});
return self.toSeekQ.clean(0, 'completed');
})
.then(function() {
return self.resume();
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment