now working
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m38s
Run linting on the backend code / Build (pull_request) Successful in 26s
Run testing on the backend code / Build (pull_request) Failing after 2m50s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 24s

This commit is contained in:
2025-01-28 11:52:07 +01:00
parent 4a904c3d3c
commit 2ac8499dfb
9 changed files with 89 additions and 80 deletions

View File

@@ -93,7 +93,7 @@ def new_trip(preferences: Preferences,
)
if len(landmarks) == 0 :
raise HTTPException(status_code=500, detail=f"No landmarks were found.")
raise HTTPException(status_code=500, detail="No landmarks were found.")
# insert start and finish to the landmarks list
landmarks_short.insert(0, start_landmark)
@@ -134,7 +134,8 @@ def new_trip(preferences: Preferences,
# upon creation of the trip, persistence of both the trip and its landmarks is ensured.
trip = Trip.from_linked_landmarks(linked_tour, cache_client)
logger.info(f'Generated a trip of {trip.total_time} minutes with {len(refined_tour)} landmarks in {round(t_generate_landmarks + t_first_stage + t_second_stage,3)} seconds.')
return trip
@@ -152,7 +153,7 @@ def get_trip(trip_uuid: str) -> Trip:
"""
try:
trip = cache_client.get(f"trip_{trip_uuid}")
background_tasks = BackgroundTasks(fill_cache())
BackgroundTasks(fill_cache())
return trip
except KeyError as exc:
raise HTTPException(status_code=404, detail="Trip not found") from exc