mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
Improve performance of dashboard (#4977)
This commit is contained in:
committed by
techknowlogick
parent
49ea6e0deb
commit
b3b7598ec6
@@ -51,7 +51,7 @@ func ListIssueComments(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
// comments,err:=models.GetCommentsByIssueIDSince(, since)
|
||||
issue, err := models.GetRawIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
issue, err := models.GetIssueByIndex(ctx.Repo.Repository.ID, ctx.ParamsInt64(":index"))
|
||||
if err != nil {
|
||||
ctx.Error(500, "GetRawIssueByIndex", err)
|
||||
return
|
||||
@@ -68,6 +68,10 @@ func ListIssueComments(ctx *context.APIContext) {
|
||||
}
|
||||
|
||||
apiComments := make([]*api.Comment, len(comments))
|
||||
if err = models.CommentList(comments).LoadPosters(); err != nil {
|
||||
ctx.Error(500, "LoadPosters", err)
|
||||
return
|
||||
}
|
||||
for i := range comments {
|
||||
apiComments[i] = comments[i].APIFormat()
|
||||
}
|
||||
@@ -114,6 +118,11 @@ func ListRepoIssueComments(ctx *context.APIContext) {
|
||||
return
|
||||
}
|
||||
|
||||
if err = models.CommentList(comments).LoadPosters(); err != nil {
|
||||
ctx.Error(500, "LoadPosters", err)
|
||||
return
|
||||
}
|
||||
|
||||
apiComments := make([]*api.Comment, len(comments))
|
||||
for i := range comments {
|
||||
apiComments[i] = comments[i].APIFormat()
|
||||
|
Reference in New Issue
Block a user