summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-06-05 13:56:37 +0200
committerDouwe Maan <douwe@gitlab.com>2015-06-05 13:56:37 +0200
commit9a50db693a301e69524dc0aadeeba03f5f3ff9db (patch)
tree976dd3ca668b895c3970647a2aa9cc9d1d8063b9
parent3f59a8f0be101c2405372d05a304540beb1b6d01 (diff)
downloadgitlab-ce-fix-long-blob-timeout.tar.gz
Fix timeout when rendering file with thousands of lines.fix-long-blob-timeout
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/shared/_file_highlight.html.haml3
2 files changed, 3 insertions, 1 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 08b879a2391..4d7d406b43f 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 7.12.0 (unreleased)
+ - Fix timeout when rendering file with thousands of lines.
- Don't notify users mentioned in code blocks or blockquotes.
- Omit link to generate labels if user does not have access to create them (Stan Hu)
- Disable changing of the source branch in merge request update API (Stan Hu)
diff --git a/app/views/shared/_file_highlight.html.haml b/app/views/shared/_file_highlight.html.haml
index fba69dd0f3f..86921f0a777 100644
--- a/app/views/shared/_file_highlight.html.haml
+++ b/app/views/shared/_file_highlight.html.haml
@@ -4,7 +4,8 @@
- blob.data.lines.to_a.size.times do |index|
- offset = defined?(first_line_number) ? first_line_number : 1
- i = index + offset
- = link_to "#L#{i}", id: "L#{i}", rel: "#L#{i}" do
+ / We're not using `link_to` because it is too slow once we get to thousands of lines.
+ %a{href: "#L#{i}", id: "L#{i}", rel: "#L#{i}"}
%i.fa.fa-link
= i
:preserve