mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-29 00:59:39 +09:00
Backport #38632 by @eliroca CommentList.loadLabels keyed the result map by label.ID but looked up by comment.ID, so every label event fell back to individual DB queries. This caused log spam for any comment where the label was deleted, since ToTimelineComment calls LoadLabel unconditionally for all comment types including those with LabelID=0. Fix the map key, skip the query when LabelID=0, demote the now rarely triggered orphaned-label log to Debug, and fix a typo ("Commit" -> "Comment") in that message. Signed-off-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Elisei Roca <eroca@suse.de> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
co-authored by
Elisei Roca
wxiaoguang
parent
375e6ea038
commit
9972bee41f
@@ -81,7 +81,7 @@ func (comments CommentList) loadLabels(ctx context.Context) error {
|
||||
}
|
||||
|
||||
for _, comment := range comments {
|
||||
comment.Label = commentLabels[comment.ID]
|
||||
comment.Label = commentLabels[comment.LabelID]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user