add qdrant client timeout limit (#1894)
Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
parent
a44022c388
commit
5ca4c4a44d
@ -197,6 +197,7 @@ class Config:
|
|||||||
# qdrant settings
|
# qdrant settings
|
||||||
self.QDRANT_URL = get_env('QDRANT_URL')
|
self.QDRANT_URL = get_env('QDRANT_URL')
|
||||||
self.QDRANT_API_KEY = get_env('QDRANT_API_KEY')
|
self.QDRANT_API_KEY = get_env('QDRANT_API_KEY')
|
||||||
|
self.QDRANT_CLIENT_TIMEOUT = get_env('QDRANT_CLIENT_TIMEOUT')
|
||||||
|
|
||||||
# milvus / zilliz setting
|
# milvus / zilliz setting
|
||||||
self.MILVUS_HOST = get_env('MILVUS_HOST')
|
self.MILVUS_HOST = get_env('MILVUS_HOST')
|
||||||
|
@ -18,6 +18,7 @@ from models.dataset import Dataset, DatasetCollectionBinding
|
|||||||
class QdrantConfig(BaseModel):
|
class QdrantConfig(BaseModel):
|
||||||
endpoint: str
|
endpoint: str
|
||||||
api_key: Optional[str]
|
api_key: Optional[str]
|
||||||
|
timeout: float = 20
|
||||||
root_path: Optional[str]
|
root_path: Optional[str]
|
||||||
|
|
||||||
def to_qdrant_params(self):
|
def to_qdrant_params(self):
|
||||||
@ -33,6 +34,7 @@ class QdrantConfig(BaseModel):
|
|||||||
return {
|
return {
|
||||||
'url': self.endpoint,
|
'url': self.endpoint,
|
||||||
'api_key': self.api_key,
|
'api_key': self.api_key,
|
||||||
|
'timeout': self.timeout
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ class VectorIndex:
|
|||||||
config=QdrantConfig(
|
config=QdrantConfig(
|
||||||
endpoint=config.get('QDRANT_URL'),
|
endpoint=config.get('QDRANT_URL'),
|
||||||
api_key=config.get('QDRANT_API_KEY'),
|
api_key=config.get('QDRANT_API_KEY'),
|
||||||
root_path=current_app.root_path
|
root_path=current_app.root_path,
|
||||||
|
timeout=config.get('QDRANT_CLIENT_TIMEOUT')
|
||||||
),
|
),
|
||||||
embeddings=embeddings
|
embeddings=embeddings
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user