From 6c35586afca1170cebae5b25f4e7225fbb99dd08 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,