diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2024-03-12 05:57:19 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-20 08:46:28 +0100 |
commit | d996c5d5179c99855e69156a034eca055e9329a4 (patch) | |
tree | f3fee65c1490f52b7f77a3395ea3ac46e1a63a34 /routers | |
parent | Remove jQuery AJAX from the issue branch reference selection (#29722) (diff) | |
download | forgejo-d996c5d5179c99855e69156a034eca055e9329a4.tar.xz forgejo-d996c5d5179c99855e69156a034eca055e9329a4.zip |
Some performance optimization on dashboard and issues page (#29010)
This PR do some loading speed optimization for feeds user interface
pages.
- Load action users batchly but not one by one.
- Load action repositories batchly but not one by one.
- Load action's Repo Owners batchly but not one by one.
- Load action's possible issues batchly but not one by one.
- Load action's possible comments batchly but not one by one.
(cherry picked from commit aed3b53abdd02a3ffbf9e8eb90272ff567333073)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/repo.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/repo.go b/routers/web/repo/repo.go index 57723e6a9a..07e6c937b0 100644 --- a/routers/web/repo/repo.go +++ b/routers/web/repo/repo.go @@ -543,9 +543,13 @@ func InitiateDownload(ctx *context.Context) { // SearchRepo repositories via options func SearchRepo(ctx *context.Context) { + page := ctx.FormInt("page") + if page <= 0 { + page = 1 + } opts := &repo_model.SearchRepoOptions{ ListOptions: db.ListOptions{ - Page: ctx.FormInt("page"), + Page: page, PageSize: convert.ToCorrectPageSize(ctx.FormInt("limit")), }, Actor: ctx.Doer, |