From fdf0076f37955d33ee788484ed9a08e5a34baa96 Mon Sep 17 00:00:00 2001 From: barisusakli <barisusakli@gmail.com> Date: Thu, 27 Mar 2014 19:59:44 -0400 Subject: [PATCH] decrease user count when user is deleted --- src/user/delete.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/user/delete.js b/src/user/delete.js index 319d2058e2..368a940341 100644 --- a/src/user/delete.js +++ b/src/user/delete.js @@ -250,7 +250,7 @@ module.exports = function(User) { db.delete('uid:' + uid + ':favourites', next); }, function(next) { - db.delete('user:' + uid + ':settings', next); + db.delete('user:' + uid + ':settings', next); }, function(next) { db.delete('uid:' + uid + ':topics', next); @@ -293,6 +293,9 @@ module.exports = function(User) { }, function(next) { db.delete('user:' + uid, next); + }, + function(next) { + db.decrObjectField('global', 'userCount'); } ], callback); });