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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-21 21:11:01 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-21 21:11:01 +0300
commitf26782b146ed115c8e36f8d6fc4c173020ab30b6 (patch)
treef9a1fd2ca9abf8d34db53739b8420e93b7e81895 /lib/gitlab/highlight.rb
parent42d323de78244a6654a5f11ec16abcec8a849e81 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/highlight.rb')
-rw-r--r--lib/gitlab/highlight.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/gitlab/highlight.rb b/lib/gitlab/highlight.rb
index e4857280969..2d58bb88816 100644
--- a/lib/gitlab/highlight.rb
+++ b/lib/gitlab/highlight.rb
@@ -11,9 +11,11 @@ module Gitlab
end
def self.too_large?(size)
- return false unless size.to_i > Gitlab.config.extra['maximum_text_highlight_size_kilobytes']
+ file_size_limit = Gitlab.config.extra['maximum_text_highlight_size_kilobytes']
- over_highlight_size_limit.increment(source: "text highlighter") if Feature.enabled?(:track_file_size_over_highlight_limit)
+ return false unless size.to_i > file_size_limit
+
+ over_highlight_size_limit.increment(source: "file size: #{file_size_limit}") if Feature.enabled?(:track_file_size_over_highlight_limit)
true
end