From 46ed56cf96bd979b6b5b45831136514a03e279f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Fri, 11 Apr 2025 19:51:18 -0400 Subject: [PATCH] refactor: use sortedSetsCard --- src/user/follow.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/user/follow.js b/src/user/follow.js index c89f90b979..9a497e6488 100644 --- a/src/user/follow.js +++ b/src/user/follow.js @@ -58,11 +58,8 @@ module.exports = function (User) { ]); } - const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await Promise.all([ - db.sortedSetCard(`following:${uid}`), - db.sortedSetCard(`followingRemote:${uid}`), - db.sortedSetCard(`followers:${theiruid}`), - db.sortedSetCard(`followersRemote:${theiruid}`), + const [followingCount, followingRemoteCount, followerCount, followerRemoteCount] = await db.sortedSetsCard([ + `following:${uid}`, `followingRemote:${uid}`, `followers:${theiruid}`, `followersRemote:${theiruid}` ]); await Promise.all([ User.setUserField(uid, 'followingCount', followingCount + followingRemoteCount),