Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix: better handle error (#11265)

yihonge686f123177b
diff --git a/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py b/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py
index 8dd26a073b2..c44338d42a5 100644
--- a/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py
+++ b/api/core/rag/datasource/vdb/oceanbase/oceanbase_vector.py
@@ -104,8 +104,7 @@ class OceanBaseVector(BaseVector):
val = int(row[6])
vals.append(val)
if len(vals) == 0:
- print("ob_vector_memory_limit_percentage not found in parameters.")
- exit(1)
+ raise ValueError("ob_vector_memory_limit_percentage not found in parameters.")
if any(val == 0 for val in vals):
try:
self._client.perform_raw_text_sql("ALTER SYSTEM SET ob_vector_memory_limit_percentage = 30")
@@ -200,10 +199,10 @@ class OceanBaseVectorFactory(AbstractVectorFactory):
return OceanBaseVector(
collection_name,
OceanBaseVectorConfig(
- host=dify_config.OCEANBASE_VECTOR_HOST,
- port=dify_config.OCEANBASE_VECTOR_PORT,
- user=dify_config.OCEANBASE_VECTOR_USER,
+ host=dify_config.OCEANBASE_VECTOR_HOST or "",
+ port=dify_config.OCEANBASE_VECTOR_PORT or 0,
+ user=dify_config.OCEANBASE_VECTOR_USER or "",
password=(dify_config.OCEANBASE_VECTOR_PASSWORD or ""),
- database=dify_config.OCEANBASE_VECTOR_DATABASE,
+ database=dify_config.OCEANBASE_VECTOR_DATABASE or "",
),
)