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)