mirror of
https://github.com/go-gitea/gitea
synced 2025-07-03 09:07:19 +00:00
Do some performance optimize for issues list and view issue/pull (#29515)
This PR do some performance optimzations. - [x] Add `index` for the column `comment_id` of `Attachment` table to accelerate query from the database. - [x] Remove unnecessary database queries when viewing issues. Before some conditions which id = 0 will be sent to the database - [x] Remove duplicated load posters - [x] Batch loading attachements, isread of comments on viewing issue --------- Co-authored-by: Zettat123 <zettat123@gmail.com>
This commit is contained in:
@ -323,10 +323,6 @@ func ListRepoIssueComments(ctx *context.APIContext) {
|
||||
ctx.Error(http.StatusInternalServerError, "LoadIssues", err)
|
||||
return
|
||||
}
|
||||
if err := comments.LoadPosters(ctx); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "LoadPosters", err)
|
||||
return
|
||||
}
|
||||
if err := comments.LoadAttachments(ctx); err != nil {
|
||||
ctx.Error(http.StatusInternalServerError, "LoadAttachments", err)
|
||||
return
|
||||
|
Reference in New Issue
Block a user