Skip to content

Commit

Permalink
improve possible performance bottleneck (go-gitea#28547)
Browse files Browse the repository at this point in the history
Replace go-gitea#28500

---------

Co-authored-by: Giteabot <teabot@gitea.io>
  • Loading branch information
lunny and GiteaBot committed Dec 21, 2023
1 parent 3142693 commit b35d3fd
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions models/issues/comment.go
Original file line number Diff line number Diff line change
Expand Up @@ -1161,14 +1161,9 @@ func DeleteComment(ctx context.Context, comment *Comment) error {
// UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id
func UpdateCommentsMigrationsByType(ctx context.Context, tp structs.GitServiceType, originalAuthorID string, posterID int64) error {
_, err := db.GetEngine(ctx).Table("comment").
Where(builder.In("issue_id",
builder.Select("issue.id").
From("issue").
InnerJoin("repository", "issue.repo_id = repository.id").
Where(builder.Eq{
"repository.original_service_type": tp,
}),
)).
Join("INNER", "issue", "issue.id = comment.issue_id").
Join("INNER", "repository", "issue.repo_id = repository.id").
Where("repository.original_service_type = ?", tp).
And("comment.original_author_id = ?", originalAuthorID).
Update(map[string]any{
"poster_id": posterID,
Expand Down

0 comments on commit b35d3fd

Please sign in to comment.