From 4689e8953e58a3a118920ba0ade164e9716a6205 Mon Sep 17 00:00:00 2001 From: kurokobo Date: Wed, 18 Jun 2025 10:25:52 +0900 Subject: [PATCH] fix: shorten connection timeout to pypi.org for deprecation check for weaviate client (#21131) --- api/core/rag/datasource/vdb/weaviate/weaviate_vector.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py index 8fe6199517..c6cf0d2b27 100644 --- a/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py +++ b/api/core/rag/datasource/vdb/weaviate/weaviate_vector.py @@ -41,6 +41,12 @@ class WeaviateVector(BaseVector): weaviate.connect.connection.has_grpc = False + # Fix to minimize the performance impact of the deprecation check in weaviate-client 3.24.0, + # by changing the connection timeout to pypi.org from 1 second to 0.001 seconds. + # TODO: This can be removed once weaviate-client is updated to 3.26.7 or higher, + # which does not contain the deprecation check. + weaviate.connect.connection.PYPI_TIMEOUT = 0.001 + try: client = weaviate.Client( url=config.endpoint, auth_client_secret=auth_config, timeout_config=(5, 60), startup_period=None