PERF: Limit new messages in suggested for PMs

unlimited the query will hunt for ancient old PMs which is very
expensive
This commit is contained in:
Sam 2017-05-26 11:00:31 -04:00
parent 076f079d17
commit b839493fea
1 changed files with 1 additions and 1 deletions

View File

@ -731,7 +731,7 @@ class TopicQuery
def new_messages(params)
TopicQuery.new_filter(messages_for_groups_or_user(params[:my_group_ids]), 10.years.ago)
TopicQuery.new_filter(messages_for_groups_or_user(params[:my_group_ids]), Time.at(SiteSetting.min_new_topics_time).to_datetime)
.limit(params[:count])
end