mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-31 11:52:10 +00:00
Performance improvement for list pull requests (#15447)
This commit is contained in:
parent
f44543a1bb
commit
8202dd1311
5 changed files with 73 additions and 30 deletions
|
@ -53,6 +53,9 @@ func (issues IssueList) loadRepositories(e Engine) ([]*Repository, error) {
|
|||
|
||||
for _, issue := range issues {
|
||||
issue.Repo = repoMaps[issue.RepoID]
|
||||
if issue.PullRequest != nil {
|
||||
issue.PullRequest.BaseRepo = issue.Repo
|
||||
}
|
||||
}
|
||||
return valuesRepository(repoMaps), nil
|
||||
}
|
||||
|
@ -516,6 +519,11 @@ func (issues IssueList) LoadDiscussComments() error {
|
|||
return issues.loadComments(x, builder.Eq{"comment.type": CommentTypeComment})
|
||||
}
|
||||
|
||||
// LoadPullRequests loads pull requests
|
||||
func (issues IssueList) LoadPullRequests() error {
|
||||
return issues.loadPullRequests(x)
|
||||
}
|
||||
|
||||
// GetApprovalCounts returns a map of issue ID to slice of approval counts
|
||||
// FIXME: only returns official counts due to double counting of non-official approvals
|
||||
func (issues IssueList) GetApprovalCounts() (map[int64][]*ReviewCount, error) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue