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:
authorStan Hu <stanhu@gmail.com>2018-07-22 09:48:12 +0300
committerStan Hu <stanhu@gmail.com>2018-07-25 01:36:31 +0300
commitc8ff6b7c73ccf42e70f7fd4675dd7f68d03739c1 (patch)
tree9a12252e2d2b6b1e0ce55df26f63eeed31a3452c /app/controllers/projects/wikis_controller.rb
parentc06e2ac888fb5180cdf133df89d03b99eceafa0d (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/controllers/projects/wikis_controller.rb')
-rw-r--r--app/controllers/projects/wikis_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects/wikis_controller.rb b/app/controllers/projects/wikis_controller.rb
index 9dc0c31be49..b7c656246ef 100644
--- a/app/controllers/projects/wikis_controller.rb
+++ b/app/controllers/projects/wikis_controller.rb
@@ -112,7 +112,7 @@ class Projects::WikisController < Projects::ApplicationController
private
def load_project_wiki
- @project_wiki = ProjectWiki.new(@project, current_user)
+ @project_wiki = load_wiki
# Call #wiki to make sure the Wiki Repo is initialized
@project_wiki.wiki
@@ -128,6 +128,10 @@ class Projects::WikisController < Projects::ApplicationController
false
end
+ def load_wiki
+ ProjectWiki.new(@project, current_user)
+ end
+
def wiki_params
params.require(:wiki).permit(:title, :content, :format, :message, :last_commit_sha)
end