diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-22 09:48:12 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-25 01:36:31 +0300 |
commit | c8ff6b7c73ccf42e70f7fd4675dd7f68d03739c1 (patch) | |
tree | 9a12252e2d2b6b1e0ce55df26f63eeed31a3452c /app/models | |
parent | c06e2ac888fb5180cdf133df89d03b99eceafa0d (diff) |
Use limit parameter to retrieve Wikis from 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 'app/models')
-rw-r--r-- | app/models/project_wiki.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/project_wiki.rb b/app/models/project_wiki.rb index 3aa56b3983f..f4b3421f04b 100644 --- a/app/models/project_wiki.rb +++ b/app/models/project_wiki.rb @@ -82,7 +82,7 @@ class ProjectWiki # Returns an Array of Gitlab WikiPage instances or an # empty Array if this Wiki has no pages. - def pages(limit: nil) + def pages(limit: 0) wiki.pages(limit: limit).map { |page| WikiPage.new(self, page, true) } end |