cap number of posts checked

activity pub returns 40k 🏮
This commit is contained in:
Barış Soner Uşaklı
2024-04-23 13:17:50 -04:00
parent 3ca42ed3ee
commit ce9e1cf19b

View File

@@ -85,7 +85,7 @@ module.exports = function (Topics) {
}
async function getTidsWithMostPostsInTerm(term) {
const pids = await db.getSortedSetRevRangeByScore('posts:pid', 0, -1, '+inf', Date.now() - Topics.getSinceFromTerm(term));
const pids = await db.getSortedSetRevRangeByScore('posts:pid', 0, 1000, '+inf', Date.now() - Topics.getSinceFromTerm(term));
const postObjs = await db.getObjectsFields(pids.map(pid => `post:${pid}`), ['tid']);
const tidToCount = {};
postObjs.forEach((post) => {