From c68ca7f032532384131ec3affffc8aab9206b0b7 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Mar 2017 07:31:19 +0900 Subject: [PATCH] [API] Beef up the recommendation algorithm --- src/api/endpoints/users/recommendation.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/api/endpoints/users/recommendation.ts b/src/api/endpoints/users/recommendation.ts index 7f5e0b5f5c..a096261e58 100644 --- a/src/api/endpoints/users/recommendation.ts +++ b/src/api/endpoints/users/recommendation.ts @@ -1,6 +1,7 @@ /** * Module dependencies */ +const ms = require('ms'); import $ from 'cafy'; import User from '../../models/user'; import serialize from '../../serializers/user'; @@ -29,6 +30,9 @@ module.exports = (params, me) => new Promise(async (res, rej) => { .find({ _id: { $nin: followingIds + }, + last_used_at: { + $gte: new Date(Date.now() - ms('7days')) } }, { limit: limit,