summaryrefslogtreecommitdiff
path: root/lib/gitlab/git
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2018-07-21 23:48:12 -0700
committerStan Hu <stanhu@gmail.com>2018-07-24 15:36:31 -0700
commitc8ff6b7c73ccf42e70f7fd4675dd7f68d03739c1 (patch)
tree9a12252e2d2b6b1e0ce55df26f63eeed31a3452c /lib/gitlab/git
parentc06e2ac888fb5180cdf133df89d03b99eceafa0d (diff)
downloadgitlab-ce-c8ff6b7c73ccf42e70f7fd4675dd7f68d03739c1.tar.gz
Use limit parameter to retrieve Wikis from Gitalysh-use-wiki-limit-parameter-gitaly
Without this parameter, every load of a Wiki page will load all the Wiki pages in the repository for the sidebar. This is a significant performance penalty that can significant slow the display of all Wiki pages. Relates to #40101
Diffstat (limited to 'lib/gitlab/git')
-rw-r--r--lib/gitlab/git/wiki.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/git/wiki.rb b/lib/gitlab/git/wiki.rb
index 8ee46b59830..9d992be66eb 100644
--- a/lib/gitlab/git/wiki.rb
+++ b/lib/gitlab/git/wiki.rb
@@ -44,9 +44,9 @@ module Gitlab
end
end
- def pages(limit: nil)
+ def pages(limit: 0)
@repository.wrapped_gitaly_errors do
- gitaly_get_all_pages
+ gitaly_get_all_pages(limit: limit)
end
end
@@ -158,8 +158,8 @@ module Gitlab
Gitlab::Git::WikiFile.new(wiki_file)
end
- def gitaly_get_all_pages
- gitaly_wiki_client.get_all_pages.map do |wiki_page, version|
+ def gitaly_get_all_pages(limit: 0)
+ gitaly_wiki_client.get_all_pages(limit: limit).map do |wiki_page, version|
Gitlab::Git::WikiPage.new(wiki_page, version)
end
end