From 168c773ba0c5747f834a4ccce86fe850fab19531 Mon Sep 17 00:00:00 2001 From: MeiMei <30769358+mei23@users.noreply.github.com> Date: Fri, 12 Oct 2018 13:48:26 +0900 Subject: [PATCH] Fix user recommendation query (last activity) (#2892) --- src/server/api/endpoints/users/recommendation.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/server/api/endpoints/users/recommendation.ts b/src/server/api/endpoints/users/recommendation.ts index f44b1c909..f54326b56 100644 --- a/src/server/api/endpoints/users/recommendation.ts +++ b/src/server/api/endpoints/users/recommendation.ts @@ -69,13 +69,10 @@ export default (params: any, me: ILocalUser) => new Promise(async (res, rej) => $nin: followingIds.concat(mutedUserIds) }, isLocked: { $ne: true }, - $or: [{ - lastUsedAt: { - $gte: new Date(Date.now() - ms('7days')) - } - }, { - host: null - }] + lastUsedAt: { + $gte: new Date(Date.now() - ms('7days')) + }, + host: null }, { limit: limit, skip: offset,