diff --git a/src/overhaul/service.py b/src/overhaul/service.py index 77917ad..f884170 100644 --- a/src/overhaul/service.py +++ b/src/overhaul/service.py @@ -89,22 +89,22 @@ async def get_overhaul_critical_parts(db_session, session_id, token): # Filter out items without matrix data (where rbd_simulation.get() returned None) filtered_result = [item for item in base_result if item["matrix"] is not None] - # Sort by availability (lowest to highest) and limit to 10 - availability_result = sorted( - filtered_result, - key=lambda x: x["matrix"]["availability"] - )[:10] - - # Sort by criticality (highest to lowest) and limit to 10 - criticality_result = sorted( - filtered_result, - key=lambda x: x["matrix"]["criticality"], - reverse=True - )[:10] + # # Sort by availability (lowest to highest) and limit to 10 + # availability_result = sorted( + # filtered_result, + # key=lambda x: x["matrix"]["availability"] + # )[:10] + + # # Sort by criticality (highest to lowest) and limit to 10 + # criticality_result = sorted( + # filtered_result, + # key=lambda x: x["matrix"]["criticality"], + # reverse=True + # )[:10] return { - "availability" : availability_result, - "criticality": criticality_result + "availability" : filtered_result[:10], + "criticality": filtered_result[:10] }