From 42657105a3a5872cc0975889c692f02383f7fa41 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Fri, 3 Oct 2025 13:40:10 +0300 Subject: [PATCH] api: Coroutinize get_built_indexes handler code "While at it". It looks much simpler this way. Signed-off-by: Pavel Emelyanov --- api/storage_service.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/api/storage_service.cc b/api/storage_service.cc index ac974bb819..33ddb60ef5 100644 --- a/api/storage_service.cc +++ b/api/storage_service.cc @@ -527,11 +527,12 @@ void set_view_builder(http_context& ctx, routes& r, sharded req) { + cf::get_built_indexes.set(r, [&vb](std::unique_ptr req) -> future { auto [ks, cf_name] = parse_fully_qualified_cf_name(req->get_path_param("name")); // Use of load_built_views() as filtering table should be in sync with // built_indexes_virtual_reader filtering with BUILT_VIEWS table - return vb.local().get_sys_ks().load_built_views().then([ks, cf_name, &vb](const std::vector& vn) mutable { + std::vector vn = co_await vb.local().get_sys_ks().load_built_views(); + { std::set vp; for (auto b : vn) { if (b.first == ks) { @@ -548,8 +549,8 @@ void set_view_builder(http_context& ctx, routes& r, sharded(res); - }); + co_return res; + } }); }