amazing cache #55
| @@ -92,6 +92,9 @@ def new_trip(preferences: Preferences, | ||||
|         preferences = preferences | ||||
|     ) | ||||
|  | ||||
|     if len(landmarks) == 0 : | ||||
|         raise HTTPException(status_code=500, detail=f"No landmarks were found.") | ||||
|  | ||||
|     # insert start and finish to the landmarks list | ||||
|     landmarks_short.insert(0, start_landmark) | ||||
|     landmarks_short.append(end_landmark) | ||||
| @@ -115,6 +118,9 @@ def new_trip(preferences: Preferences, | ||||
|         refined_tour = refiner.refine_optimization(landmarks, base_tour, | ||||
|                                                preferences.max_time_minute, | ||||
|                                                preferences.detour_tolerance_minute) | ||||
|     except TimeoutError as te : | ||||
|         logger.error(f'Refiner failed : {str(te)} Using base tour.') | ||||
|         refined_tour = base_tour | ||||
|     except Exception as exc : | ||||
|         raise HTTPException(status_code=500, detail=f"An unexpected error occurred: {str(exc)}") from exc | ||||
|  | ||||
|   | ||||
| @@ -588,7 +588,7 @@ class Optimizer: | ||||
|         circles = self.is_connected(solution) | ||||
|  | ||||
|         i = 0 | ||||
|         timeout = 40 | ||||
|         timeout = 15 | ||||
|         while circles is not None : | ||||
|             i += 1 | ||||
|             if i == timeout : | ||||
|   | ||||
		Reference in New Issue
	
	Block a user