summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/repo/repo.go
diff options
context:
space:
mode:
authorGusted <williamzijl7@hotmail.com>2022-04-26 20:34:30 +0000
committerGitHub <noreply@github.com>2022-04-26 16:34:30 -0400
commit076eaad7430dd80f202446487c99e95e8d803ab3 (patch)
tree6947ade9f26ffba8a23e384f7ad99562acd03f22 /routers/api/v1/repo/repo.go
parent89eec15dd90e50c36051eb3f6a2ed2616c513ad8 (diff)
downloadgitea-076eaad7430dd80f202446487c99e95e8d803ab3.tar.gz
gitea-076eaad7430dd80f202446487c99e95e8d803ab3.zip
Improve dashboard's repo list performance (#18963)
* Improve dashboard's repo list performance - Avoid a lot of database lookups for all the repo's, by adding a undocumented "minimal" mode for this specific task, which returns the data that's only needed by this list which doesn't require any database lookups. - Makes fetching these list faster. - Less CPU overhead when a user visits home page. * Refactor javascript code + fix Fork icon - Use async in the function so we can use `await`. - Remove `archivedFilter` check for count, as it doesn't make sense to show the count of repos when you can't even see them(as they are filited away). * Add `count_only` * Remove uncessary code * Improve comment Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * Update web_src/js/components/DashboardRepoList.js Co-authored-by: delvh <dev.lh@web.de> * By default apply minimal mode * Remove `minimal` paramater * Refactor count header * Simplify init Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: zeripath <art27@cantab.net>
Diffstat (limited to 'routers/api/v1/repo/repo.go')
-rw-r--r--routers/api/v1/repo/repo.go1
1 files changed, 0 insertions, 1 deletions
diff --git a/routers/api/v1/repo/repo.go b/routers/api/v1/repo/repo.go
index 16942dd3ba..cec4c93d19 100644
--- a/routers/api/v1/repo/repo.go
+++ b/routers/api/v1/repo/repo.go
@@ -218,7 +218,6 @@ func Search(ctx *context.APIContext) {
}
results[i] = convert.ToRepo(repo, accessMode)
}
-
ctx.SetLinkHeader(int(count), opts.PageSize)
ctx.SetTotalCountHeader(count)
ctx.JSON(http.StatusOK, api.SearchResults{