From 71abeabbd230956aff408c4bad33abb6661102c0 Mon Sep 17 00:00:00 2001 From: Helldragon67 Date: Mon, 27 Jan 2025 19:13:12 +0100 Subject: [PATCH] moved tasks --- .gitea/workflows/backend_run_test.yaml | 2 +- backend/src/main.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitea/workflows/backend_run_test.yaml b/.gitea/workflows/backend_run_test.yaml index b5fa349..4591358 100644 --- a/.gitea/workflows/backend_run_test.yaml +++ b/.gitea/workflows/backend_run_test.yaml @@ -28,7 +28,7 @@ jobs: working-directory: backend - name: Run Tests - run: pipenv run pytest src --html=report.html --self-contained-html --log-cli-level=INFO + run: pipenv run pytest src --html=report.html --self-contained-html --log-cli-level=DEBUG working-directory: backend - name: Upload HTML report diff --git a/backend/src/main.py b/backend/src/main.py index 85b7f5b..ba96d18 100644 --- a/backend/src/main.py +++ b/backend/src/main.py @@ -135,6 +135,8 @@ 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 @@ -152,7 +154,6 @@ 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