Performance improvements for pull request list page (#29900)
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 --------- Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
parent
01500957c2
commit
62f8174aa2
14 changed files with 86 additions and 50 deletions
|
@ -177,8 +177,7 @@ func createOutdatedPR(t *testing.T, actor, forkOrg *user_model.User) *issues_mod
|
|||
assert.NoError(t, err)
|
||||
|
||||
issue := unittest.AssertExistsAndLoadBean(t, &issues_model.Issue{Title: "Test Pull -to-update-"})
|
||||
pr, err := issues_model.GetPullRequestByIssueID(db.DefaultContext, issue.ID)
|
||||
assert.NoError(t, err)
|
||||
assert.NoError(t, issue.LoadPullRequest(db.DefaultContext))
|
||||
|
||||
return pr
|
||||
return issue.PullRequest
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue