dont make db call if ap disabled

This commit is contained in:
Barış Soner Uşaklı
2025-03-24 16:02:28 -04:00
committed by Julian Lam
parent 00cd1817f6
commit 70dac3aede

View File

@@ -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;