Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
aliasProvider.findById(process.argv[2], true, function(alias){
sys.puts(sys.inspect(alias));
client.close();
});
redis.keys('lock:*', function(locks){
var i = 0, garbage = [], gc=0;
if (!locks){
sys.puts("No locks found");
redis.close();
return;
}
for (i = 0; i < locks.length; i++){
(function(lockset){
redis.get(lockset, function(exp){
gc++;
if (exp < (new Date()).getTime()){
garbage.unshift(lockset);
}
if (gc >= locks.length){
if (garbage.length > 0){
sys.puts("Pruning: "+garbage.join(', '));
garbage[garbage.length] = function(data){
sys.puts(data + ' sets removed');
redis.close();
};