Commit d60da229 authored by Volker Krause's avatar Volker Krause
Browse files

Only cache OTP location results if they contain no realtime elements

That is, cache stations but not vehicles.
parent f73e433d
......@@ -89,7 +89,10 @@ bool OpenTripPlannerGraphQLBackend::queryLocation(const LocationRequest &req, Lo
} else {
res = p.parseLocationsByName(gqlReply.data());
}
Cache::addLocationCacheEntry(backendId(), reply->request().cacheKey(), res, {});
// only cache results if there is no realtime data involved
if ((req.types() & (Location::RentedVehicle | Location::RentedVehicleStation)) == 0) {
Cache::addLocationCacheEntry(backendId(), reply->request().cacheKey(), res, {});
}
addResult(reply, std::move(res));
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment