From f324acb83cd4b959c2646bab459a236215b57c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=AD=90=E9=BB=98?= <925456043@qq.com> Date: Thu, 28 May 2026 11:16:09 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=E5=90=91=E9=87=8F?= =?UTF-8?q?=E5=BA=93=E8=BF=9E=E6=8E=A5=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../easyagents/store/milvus/MilvusVectorStore.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/easy-agents-store/easy-agents-store-milvus/src/main/java/com/easyagents/store/milvus/MilvusVectorStore.java b/easy-agents-store/easy-agents-store-milvus/src/main/java/com/easyagents/store/milvus/MilvusVectorStore.java index aadd67e..aed63f1 100644 --- a/easy-agents-store/easy-agents-store-milvus/src/main/java/com/easyagents/store/milvus/MilvusVectorStore.java +++ b/easy-agents-store/easy-agents-store-milvus/src/main/java/com/easyagents/store/milvus/MilvusVectorStore.java @@ -47,7 +47,7 @@ import java.util.*; /** * Milvus vector store based on Milvus Java SDK v2. */ -public class MilvusVectorStore extends DocumentStore { +public class MilvusVectorStore extends DocumentStore implements AutoCloseable { private static final Logger LOG = LoggerFactory.getLogger(MilvusVectorStore.class); private static final long LOAD_TIMEOUT_MS = 30_000L; @@ -546,4 +546,14 @@ public class MilvusVectorStore extends DocumentStore { return false; } } + + @Override + public void close() { + try { + client.close(1L); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + LOG.warn("Interrupted while closing Milvus client. uri={}", config.getUri(), e); + } + } }