From 6ad749eeedd31857519852340cb66727d8713132 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Wed, 9 Oct 2024 16:10:40 +0200 Subject: [PATCH] fix? bug where landmarks are returned as none --- backend/src/structs/trip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/backend/src/structs/trip.py b/backend/src/structs/trip.py index c8ead07..8d72434 100644 --- a/backend/src/structs/trip.py +++ b/backend/src/structs/trip.py @@ -22,7 +22,8 @@ class Trip(BaseModel): # Store the trip in the cache cache_client.set(f"trip_{trip.uuid}", trip) - cache_client.set_many({f"landmark_{landmark.uuid}": landmark for landmark in landmarks}, expire=3600) + # make sure to await the result (noreply=False). Otherwise the cache might not be inplace when the trip is actually requested + cache_client.set_many({f"landmark_{landmark.uuid}": landmark for landmark in landmarks}, expire=3600, noreply=False) # is equivalent to: # for landmark in landmarks: # cache_client.set(f"landmark_{landmark.uuid}", landmark, expire=3600)