loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "improve possible performance bottleneck (#28547)" (#28593)

This reverts commit b35d3fddfac389a7be401a63b4e1283dd74af681.

This is totally wrong. I think `Update join` hasn't been supported well
by xorm.

I just revert the PR and will try to send another one.

authored by

Lunny Xiao and committed by
GitHub
0407a402 7396e361

+8 -3
+8 -3
models/issues/comment.go
··· 1161 1161 // UpdateCommentsMigrationsByType updates comments' migrations information via given git service type and original id and poster id 1162 1162 func UpdateCommentsMigrationsByType(ctx context.Context, tp structs.GitServiceType, originalAuthorID string, posterID int64) error { 1163 1163 _, err := db.GetEngine(ctx).Table("comment"). 1164 - Join("INNER", "issue", "issue.id = comment.issue_id"). 1165 - Join("INNER", "repository", "issue.repo_id = repository.id"). 1166 - Where("repository.original_service_type = ?", tp). 1164 + Where(builder.In("issue_id", 1165 + builder.Select("issue.id"). 1166 + From("issue"). 1167 + InnerJoin("repository", "issue.repo_id = repository.id"). 1168 + Where(builder.Eq{ 1169 + "repository.original_service_type": tp, 1170 + }), 1171 + )). 1167 1172 And("comment.original_author_id = ?", originalAuthorID). 1168 1173 Update(map[string]any{ 1169 1174 "poster_id": posterID,