Make 'Popular' page faster

Problem: The popular page is ungodly slow.

Solution: Make it faster! This is done by checking the timestamp before
the other constraints that we add to messages, which is mostly useful
because most messages that fail the filter will fail on the timestamp
check.
This commit is contained in:
Christian Bundy 2020-01-30 18:15:22 -08:00
parent 671c5f3fd3
commit 10fd740ef7
1 changed files with 2 additions and 2 deletions

View File

@ -685,11 +685,11 @@ module.exports = cooler => {
source,
pull.filter(msg => {
return (
msg.value.timestamp > earliest &&
typeof msg.value.content === "object" &&
typeof msg.value.content.vote === "object" &&
typeof msg.value.content.vote.link === "string" &&
typeof msg.value.content.vote.value === "number" &&
msg.value.timestamp > earliest
typeof msg.value.content.vote.value === "number"
);
}),
pull.reduce(