Skip to content

Commit a7e144f

Browse files
committed
Add comment and fix test
1 parent 4e974f1 commit a7e144f

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

models/issues/review_list.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ func GetReviewsByIssueID(ctx context.Context, issueID int64) (ReviewList, Review
168168

169169
// filter them in memory to get the latest review of each reviewer
170170
// Since the reviewes should not be too many for one issue, less than 100 commonly, it's acceptable to do this in memory
171+
// And since there are too less indexes in review table, it will be very slow to filter in the database
171172
reviewersMap := make(map[int64][]*Review) // key is reviewer id
172173
originalReviewersMap := make(map[int64][]*Review)
173174
reviewTeamsMap := make(map[int64][]*Review)

models/issues/review_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func TestGetReviewersByIssueID(t *testing.T) {
162162
},
163163
)
164164

165-
allReviews, err := issues_model.GetReviewsByIssueID(db.DefaultContext, issue.ID)
165+
allReviews, _, err := issues_model.GetReviewsByIssueID(db.DefaultContext, issue.ID)
166166
assert.NoError(t, err)
167167
for _, review := range allReviews {
168168
assert.NoError(t, review.LoadReviewer(db.DefaultContext))

0 commit comments

Comments
 (0)