mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
refactor: use sortedSetsCard
This commit is contained in:
@@ -58,11 +58,8 @@ module.exports = function (User) {
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await Promise.all([
|
const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await db.sortedSetsCard([
|
||||||
db.sortedSetCard(`following:${uid}`),
|
`following:${uid}`, `followingRemote:${uid}`, `followers:${theiruid}`, `followersRemote:${theiruid}`
|
||||||
db.sortedSetCard(`followingRemote:${uid}`),
|
|
||||||
db.sortedSetCard(`followers:${theiruid}`),
|
|
||||||
db.sortedSetCard(`followersRemote:${theiruid}`),
|
|
||||||
]);
|
]);
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
User.setUserField(uid, 'followingCount', followingCount + followingRemoteCount),
|
User.setUserField(uid, 'followingCount', followingCount + followingRemoteCount),
|
||||||
|
|||||||
Reference in New Issue
Block a user