-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #16069: Add a "Newest First" tag for reviewable questions #16534
Changes from 1 commit
0366952
412fca4
5283c47
45fc067
449dc4b
748de42
9f470bb
581281c
baa32ff
8370912
c33e9d3
304673a
5734746
75bc4d8
6c2bfdd
807fdc8
e04ce60
8cc15ce
19371f4
44c8d20
0959288
b7848b1
91f889c
39de584
c3fc3b4
3f3e83e
766a329
8d9849a
4e80671
428f2ee
a7cadb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -648,7 +648,7 @@ def get_in_review_question_suggestions_by_offset( | |
sorted_results: List[GeneralSuggestionModel] = [] | ||
|
||
while len(sorted_results) < limit: | ||
suggestion_model: GeneralSuggestionModel = ( | ||
suggestion_model: Sequence[GeneralSuggestionModel] = ( | ||
suggestion_query.fetch(1, offset=offset)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fetching one by one will take a very long time. Why not fetch in larger batches (say 1000), go through the results, and filter manually as needed? Please test this locally with 10000 items, try to make it so that the difference between 10k items and 1 item is not high (you can achieve this by doing a single fetch call rather than many). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a good suggestion. I tested the new codes locally. The execution time of the function |
||
if not suggestion_model: | ||
break | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a list of models, so the name is misleading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I changed it to
suggestion_models