Performance improvements for pull request list page (#29900) (#29972)

This PR will avoid load pullrequest.Issue twice in pull request list
page. It will reduce x times database queries for those WIP pull
requests.

Partially fix #29585
Backport #29900
This commit is contained in:
Lunny Xiao
2024-03-22 09:58:04 +08:00
committed by GitHub
parent c03b1e2854
commit 6ef986d474
14 changed files with 85 additions and 49 deletions

View File

@@ -128,6 +128,12 @@ func getNotifications(ctx *context.Context) {
ctx.ServerError("LoadIssues", err)
return
}
if err = notifications.LoadIssuePullRequests(ctx); err != nil {
ctx.ServerError("LoadIssuePullRequests", err)
return
}
notifications = notifications.Without(failures)
failCount += len(failures)