From 1efecaef1f867cb218366e2b4ab4b901fdd2835f Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 4 Jul 2026 14:54:45 +0900 Subject: 途中経過コミット MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mcp/tools/rebuild_index.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'src/mcp/tools/rebuild_index.c') diff --git a/src/mcp/tools/rebuild_index.c b/src/mcp/tools/rebuild_index.c index e6dbf69..d9a5e87 100644 --- a/src/mcp/tools/rebuild_index.c +++ b/src/mcp/tools/rebuild_index.c @@ -10,8 +10,6 @@ call_rebuild_index(const mcpc_tool_t *tool, mcpc_ucbr_t *result) { tiny_mcp_tools_context_t *context = tiny_mcp_tools_context_current(); tiny_rebuild_report_t report; - tiny_search_index_t *rebuilt; - tiny_history_index_t *history; tiny_store_status_t status; tiny_json_buffer_t json; (void)tool; @@ -26,22 +24,7 @@ call_rebuild_index(const mcpc_tool_t *tool, mcpc_ucbr_t *result) tiny_mcp_tool_add_error(result, tiny_store_status_name(status), "index rebuild failed"); return; } - tiny_history_index_free(context->history_index); - context->history_index = NULL; - rebuilt = tiny_mcp_tools_build_search_index(context->store); - history = tiny_history_index_build(context->store); - if (!rebuilt || !history) - { - tiny_search_index_free(rebuilt); - tiny_history_index_free(history); - tiny_search_index_free(context->search_index); - context->search_index = NULL; - tiny_mcp_tool_add_error(result, "INTERNAL_ERROR", "search index allocation failed"); - return; - } - tiny_search_index_free(context->search_index); - context->search_index = rebuilt; - context->history_index = history; + tiny_mcp_tools_invalidate_indexes(context); tiny_json_init(&json); tiny_json_raw(&json, "{\"status\":\"OK\",\"messages_indexed\":"); tiny_json_u64(&json, report.messages_indexed); -- cgit v1.2.3