cache later
Some checks failed
Build and deploy the backend to staging / Build and push image (pull_request) Successful in 1m37s
Run linting on the backend code / Build (pull_request) Successful in 28s
Run testing on the backend code / Build (pull_request) Failing after 3m29s
Build and deploy the backend to staging / Deploy to staging (pull_request) Successful in 23s

This commit is contained in:
2025-01-27 18:29:50 +01:00
parent a3243431e0
commit d6f723bee1
7 changed files with 132 additions and 114 deletions

View File

@@ -129,8 +129,6 @@ def new_trip(preferences: Preferences,
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.')
background_tasks = BackgroundTasks(fill_cache())
return trip
@@ -148,6 +146,7 @@ def get_trip(trip_uuid: str) -> Trip:
"""
try:
trip = cache_client.get(f"trip_{trip_uuid}")
background_tasks = BackgroundTasks(fill_cache())
return trip
except KeyError as exc:
raise HTTPException(status_code=404, detail="Trip not found") from exc