Browse Source

fix: shorten connection timeout to pypi.org for deprecation check for weaviate client (#21131)

tags/1.5.0
kurokobo 4 months ago
parent
commit
4689e8953e
No account linked to committer's email address
1 changed files with 6 additions and 0 deletions
  1. 6
    0
      api/core/rag/datasource/vdb/weaviate/weaviate_vector.py

+ 6
- 0
api/core/rag/datasource/vdb/weaviate/weaviate_vector.py View File



weaviate.connect.connection.has_grpc = False 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: try:
client = weaviate.Client( client = weaviate.Client(
url=config.endpoint, auth_client_secret=auth_config, timeout_config=(5, 60), startup_period=None url=config.endpoint, auth_client_secret=auth_config, timeout_config=(5, 60), startup_period=None

Loading…
Cancel
Save