1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-31 22:58:35 +00:00

Performance optimization for pull request files loading comments attachments (#33585) (#33592)

Backport #33585 by @lunny

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Giteabot
2025-02-14 16:06:46 +08:00
committed by GitHub
parent cc6ec56738
commit 5e9cc919cf
3 changed files with 11 additions and 9 deletions

View File

@@ -86,8 +86,10 @@ func findCodeComments(ctx context.Context, opts FindCommentsOptions, issue *Issu
ids = append(ids, comment.ReviewID)
}
}
if err := e.In("id", ids).Find(&reviews); err != nil {
return nil, err
if len(ids) > 0 {
if err := e.In("id", ids).Find(&reviews); err != nil {
return nil, err
}
}
n := 0