From befaa56ad00f44416c3e9e9b155fc62e8e72a360 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Wed, 19 Mar 2014 20:40:34 -0400 Subject: [PATCH] derp derp derp more refactoring of groups --- src/groups.js | 37 +------------------------------------ 1 file changed, 1 insertion(+), 36 deletions(-) diff --git a/src/groups.js b/src/groups.js index 933c4d0846..888c2969d6 100644 --- a/src/groups.js +++ b/src/groups.js @@ -6,6 +6,7 @@ Groups.getGidFromName Groups.joinByGroupName Groups.leaveByGroupName + Groups.prune */ var async = require('async'), @@ -322,40 +323,4 @@ }); }); }; - - // Not checked - Groups.prune = function(callback) { - // Actually deletes groups (with the deleted flag) from the redis database - db.getObjectValues('group:gid', function (err, gids) { - var groupsDeleted = 0; - - async.each(gids, function(gid, next) { - Groups.get(gid, {}, function(err, groupObj) { - if(err) { - return next(err); - } - - if (parseInt(groupObj.deleted, 10) === 1) { - - db.deleteObjectField('group:gid', groupObj.name, function(err) { - db.delete('gid:' + gid, function(err) { - groupsDeleted++; - next(null); - }); - }); - } else { - next(null); - } - }); - }, function(err) { - - if (!err && process.env.NODE_ENV === 'development') { - winston.info('[groups.prune] Pruned ' + groupsDeleted + ' deleted groups from Redis'); - } - - callback(err); - }); - }); - }; - }(module.exports));