perf: 优化向量库连接性能
This commit is contained in:
@@ -47,7 +47,7 @@ import java.util.*;
|
|||||||
/**
|
/**
|
||||||
* Milvus vector store based on Milvus Java SDK v2.
|
* 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 Logger LOG = LoggerFactory.getLogger(MilvusVectorStore.class);
|
||||||
private static final long LOAD_TIMEOUT_MS = 30_000L;
|
private static final long LOAD_TIMEOUT_MS = 30_000L;
|
||||||
@@ -546,4 +546,14 @@ public class MilvusVectorStore extends DocumentStore {
|
|||||||
return false;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user