Skip to content

Commit

Permalink
fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
vemonet committed Jul 17, 2023
1 parent a6d593c commit 0f16714
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions backend/app/graphql.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ async def evaluations(self, info: Info,
{'$match': filter_eval},
{'$sort': { 'created_at': -1 }},
{'$limit': 1000}
# {'$group': {'_id':''}}
# TODO: quick fix to return a max of 1000 evaluations and avoid overloading
# We should add proper pagination though
], allowDiskUse=True)
eval_list = []
async for eval in evaluations:
Expand Down Expand Up @@ -222,8 +223,4 @@ async def evaluations(self, info: Info,
if 'duration' not in eval.keys():
eval['duration'] = ""
eval_list.append(EvaluationModel(**eval))
# TODO: quick fix to return a max of 2000 evaluations and avoid overloading
# We should add proper pagination though
if len(eval_list) >= 2000:
break
return eval_list

0 comments on commit 0f16714

Please sign in to comment.