From 82edd70d7f0d9afe383f1d512e7ce200b37f5577 Mon Sep 17 00:00:00 2001 From: Tor Egge Date: Thu, 5 Dec 2024 20:43:06 +0100 Subject: [PATCH] Only show cache in custom state api when enabled. --- searchcore/src/vespa/searchcore/proton/server/proton.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/searchcore/src/vespa/searchcore/proton/server/proton.cpp b/searchcore/src/vespa/searchcore/proton/server/proton.cpp index b62236c6312..843168e1fa7 100644 --- a/searchcore/src/vespa/searchcore/proton/server/proton.cpp +++ b/searchcore/src/vespa/searchcore/proton/server/proton.cpp @@ -1073,7 +1073,8 @@ Proton::get_child(std::string_view name) const return std::make_unique(_hw_info); } else if (name == SESSION) { return std::make_unique(*_sessionManager); - } else if (name == CACHE_NAME && _posting_list_cache) { + } else if (name == CACHE_NAME && _posting_list_cache && + (_posting_list_cache->enabled_for_posting_lists() || _posting_list_cache->enabled_for_bitvectors())) { return std::make_unique(*_posting_list_cache); } return {};