mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-06-27 02:00:02 +02:00
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> (cherry picked from commit 62f8174aa2fae1481c7e17a6afcb731a5b178cd0) Conflicts: models/activities/notification_list.go moved to models/activities/notification.go
This commit is contained in:
parent
0f4614004e
commit
d92c2048b3
14 changed files with 86 additions and 50 deletions
|
@ -61,8 +61,9 @@ func ToNotificationThread(ctx context.Context, n *activities_model.Notification)
|
|||
result.Subject.LatestCommentHTMLURL = comment.HTMLURL(ctx)
|
||||
}
|
||||
|
||||
pr, _ := n.Issue.GetPullRequest(ctx)
|
||||
if pr != nil && pr.HasMerged {
|
||||
if err := n.Issue.LoadPullRequest(ctx); err == nil &&
|
||||
n.Issue.PullRequest != nil &&
|
||||
n.Issue.PullRequest.HasMerged {
|
||||
result.Subject.State = "merged"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue