Last active
October 5, 2016 07:08
-
-
Save Bersam/c46148decf0acf4b8544a66f13f11bcd to your computer and use it in GitHub Desktop.
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 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