mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-11 16:35:47 +01:00
removed updateUserCount
This commit is contained in:
@@ -90,6 +90,9 @@ module.exports = function(User) {
|
|||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
async.parallel([
|
async.parallel([
|
||||||
|
function(next) {
|
||||||
|
db.incrObjectField('global', 'userCount', next);
|
||||||
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
db.sortedSetAdd('username:uid', userData.uid, userData.username, next);
|
db.sortedSetAdd('username:uid', userData.uid, userData.username, next);
|
||||||
},
|
},
|
||||||
@@ -141,9 +144,6 @@ module.exports = function(User) {
|
|||||||
], next);
|
], next);
|
||||||
},
|
},
|
||||||
function(results, next) {
|
function(results, next) {
|
||||||
db.incrObjectField('global', 'userCount', next);
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
if (userNameChanged) {
|
if (userNameChanged) {
|
||||||
User.notifications.sendNameChangeNotification(userData.uid, userData.username);
|
User.notifications.sendNameChangeNotification(userData.uid, userData.username);
|
||||||
}
|
}
|
||||||
@@ -155,15 +155,6 @@ module.exports = function(User) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
User.updateUserCount = function(callback) {
|
|
||||||
db.sortedSetCard('users:joindate', function(err, count) {
|
|
||||||
if (err) {
|
|
||||||
return callback(err);
|
|
||||||
}
|
|
||||||
db.setObjectField('global', 'userCount', count, callback);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
function isDataValid(userData, callback) {
|
function isDataValid(userData, callback) {
|
||||||
async.parallel({
|
async.parallel({
|
||||||
emailValid: function(next) {
|
emailValid: function(next) {
|
||||||
|
|||||||
@@ -79,6 +79,9 @@ module.exports = function(User) {
|
|||||||
'users:online'
|
'users:online'
|
||||||
], uid, next);
|
], uid, next);
|
||||||
},
|
},
|
||||||
|
function(next) {
|
||||||
|
db.decrObjectField('global', 'userCount', next);
|
||||||
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
var keys = [
|
var keys = [
|
||||||
'uid:' + uid + ':notifications:read', 'uid:' + uid + ':notifications:unread',
|
'uid:' + uid + ':notifications:read', 'uid:' + uid + ':notifications:unread',
|
||||||
@@ -107,14 +110,7 @@ module.exports = function(User) {
|
|||||||
return callback(err);
|
return callback(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
async.parallel([
|
db.deleteAll(['followers:' + uid, 'following:' + uid, 'user:' + uid], callback);
|
||||||
function(next) {
|
|
||||||
db.deleteAll(['followers:' + uid, 'following:' + uid, 'user:' + uid], next);
|
|
||||||
},
|
|
||||||
function(next) {
|
|
||||||
User.updateUserCount(next);
|
|
||||||
}
|
|
||||||
], callback);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user