From 65537d997f4155a483638cd15716caabdc37aca9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 9 Jan 2015 09:43:45 -0500 Subject: [PATCH] if a group is deleted, flush the owner and pending sets, too --- src/groups.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/groups.js b/src/groups.js index 6286fe7a9d..f8d5470035 100644 --- a/src/groups.js +++ b/src/groups.js @@ -500,15 +500,11 @@ var async = require('async'), Groups.destroy = function(groupName, callback) { async.parallel([ - function(next) { - db.delete('group:' + groupName, next); - }, - function(next) { - db.setRemove('groups', groupName, next); - }, - function(next) { - db.delete('group:' + groupName + ':members', next); - }, + async.apply(db.delete, 'group:' + groupName), + async.apply(db.setRemove, 'groups', groupName), + async.apply(db.delete, 'group:' + groupName + ':members'), + async.apply(db.delete, 'group:' + groupName + ':pending'), + async.apply(db.delete, 'group:' + groupName + ':owners'), function(next) { db.getSetMembers('groups', function(err, groups) { if (err) {