mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-05 07:10:30 +01:00
dont make db call if ap disabled
This commit is contained in:
committed by
Julian Lam
parent
00cd1817f6
commit
70dac3aede
@@ -48,7 +48,7 @@ User.exists = async function (uids) {
|
||||
|
||||
const [localExists, remoteExists] = await Promise.all([
|
||||
db.isSortedSetMembers('users:joindate', uids),
|
||||
db.exists(uids.map(uid => `userRemote:${uid}`)),
|
||||
meta.config.activitypubEnabled ? db.exists(uids.map(uid => `userRemote:${uid}`)) : uids.map(() => false),
|
||||
]);
|
||||
const results = localExists.map((local, idx) => local || remoteExists[idx]);
|
||||
return singular ? results.pop() : results;
|
||||
|
||||
Reference in New Issue
Block a user