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>2020-02-19 18:09:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 18:09:09 +0300
commitc7e385e282bcb8505589bce526e692b7bb819ffa (patch)
tree3e64affe1c2eebdcaa18cc6319b603f44b03b07e /lib/gitlab/utils
parentcd3e2c7b9355f8990ab294b34b5e4add4f3985fa (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/utils')
-rw-r--r--lib/gitlab/utils/log_limited_array.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/utils/log_limited_array.rb b/lib/gitlab/utils/log_limited_array.rb
index fe8aadf9020..9c207758580 100644
--- a/lib/gitlab/utils/log_limited_array.rb
+++ b/lib/gitlab/utils/log_limited_array.rb
@@ -6,9 +6,9 @@ module Gitlab
MAXIMUM_ARRAY_LENGTH = 10.kilobytes
# Prepare an array for logging by limiting its JSON representation
- # to around 10 kilobytes. Once we hit the limit, add "..." as the
- # last item in the returned array.
- def self.log_limited_array(array)
+ # to around 10 kilobytes. Once we hit the limit, add the sentinel
+ # value as the last item in the returned array.
+ def self.log_limited_array(array, sentinel: '...')
return [] unless array.is_a?(Array)
total_length = 0
@@ -18,7 +18,7 @@ module Gitlab
total_length <= MAXIMUM_ARRAY_LENGTH
end
- limited_array.push('...') if total_length > MAXIMUM_ARRAY_LENGTH
+ limited_array.push(sentinel) if total_length > MAXIMUM_ARRAY_LENGTH
limited_array
end