From 37302eb352d8c71757116f40ddadd24997ffae4a Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Thu, 2 Dec 2021 17:31:26 +0100 Subject: [PATCH] Explain better --- apollo-router/src/apollo_router.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apollo-router/src/apollo_router.rs b/apollo-router/src/apollo_router.rs index 3c1dec89f6..e605ca753a 100644 --- a/apollo-router/src/apollo_router.rs +++ b/apollo-router/src/apollo_router.rs @@ -50,10 +50,10 @@ impl ApolloRouter { // We don't need to do this in background because the old server will keep running until // this one is ready. // - // We might lose the benefit of warming the cache up, since it could immediately get some - // queries that could have been precalculated. If we block on warming up, starting the - // router is slightly slower, but when reloading configuration there's no delay, we create - // the router before restarting the server + // If we first warm up the cache in foreground, then switch to the new config, the next + // queries will benefit from the warmed up cache. While if we switch and warm up in + // background, the next queries might be blocked until the cache is primed, so there'll be + // a perf hit. if let Some(previous_router) = previous_router { for (query, operation, options) in previous_router.query_planner.get_hot_keys().await { // We can ignore errors because some of the queries that were previously in the