mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Forced summary mode for megalodon topics.
This is mainly done for performance reasons and megalodon topics are usually a byproduct of imports where site setting limits are not respected.
This commit is contained in:
@ -482,9 +482,9 @@ class TopicView
|
||||
@filtered_posts = unfiltered_posts
|
||||
|
||||
# Filters
|
||||
if @filter == 'summary'
|
||||
if @filter == 'summary' || force_summary_mode?
|
||||
@filtered_posts = @filtered_posts.summary(@topic.id)
|
||||
@contains_gaps = true
|
||||
@contains_gaps = true unless force_summary_mode?
|
||||
end
|
||||
|
||||
if @best.present?
|
||||
@ -572,4 +572,9 @@ class TopicView
|
||||
def is_mega_topic?
|
||||
@topic.posts_count >= MEGA_TOPIC_POSTS_COUNT
|
||||
end
|
||||
|
||||
def force_summary_mode?
|
||||
@force_summary_mode ||=
|
||||
(@topic.closed? && @topic.posts_count >= (MEGA_TOPIC_POSTS_COUNT * 2))
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user