Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswaldo Ferreira <oswaldo@gitlab.com>2018-12-16 19:00:43 +0300
committerOswaldo Ferreira <oswaldo@gitlab.com>2018-12-21 21:59:21 +0300
commit7cf4947792647fd985c38ebf37c27989fd5a1632 (patch)
tree46bef7a798e8749e815f594a918266c8d9f9dd61 /app/models/concerns/noteable.rb
parenta9049532a271117983430d2d80b8ad61879ecf7a (diff)
Cache diff highlight in discussions
This commit handles note diffs caching, which considerably improves the performance on merge requests with lots of comments. Important to note that the caching approach taken here is different from `Gitlab::Diff::HighlightCache`. We do not reset the whole cache when a new push is sent or anything else. That's because discussions diffs are persisted and do not change.
Diffstat (limited to 'app/models/concerns/noteable.rb')
-rw-r--r--app/models/concerns/noteable.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/concerns/noteable.rb b/app/models/concerns/noteable.rb
index f2cad09e779..29476654bf7 100644
--- a/app/models/concerns/noteable.rb
+++ b/app/models/concerns/noteable.rb
@@ -34,6 +34,10 @@ module Noteable
false
end
+ def preloads_discussion_diff_highlighting?
+ false
+ end
+
def discussion_notes
notes
end