|
@@ -1,3 +1,4 @@
|
|
|
+import os
|
|
|
import sys
|
|
|
|
|
|
from loguru import logger
|
|
@@ -18,12 +19,13 @@ class MilvusHelper:
|
|
|
try:
|
|
|
self.collection = None
|
|
|
connections.connect(
|
|
|
- host=settings.MILVUS_HOST,
|
|
|
- port=settings.MILVUS_PORT,
|
|
|
+ host=os.getenv("MILVUS_HOST", settings.MILVUS_HOST),
|
|
|
+ port=os.getenv("MILVUS_PORT", settings.MILVUS_PORT),
|
|
|
)
|
|
|
logger.debug(
|
|
|
f"Successfully connect to Milvus with IP: "
|
|
|
- f"{settings.MILVUS_HOST} and PORT: {settings.MILVUS_PORT}"
|
|
|
+ f"{os.getenv('MILVUS_HOST', settings.MILVUS_HOST)} "
|
|
|
+ f"and PORT: {os.getenv('MILVUS_PORT', settings.MILVUS_PORT)}"
|
|
|
)
|
|
|
except Exception as e:
|
|
|
logger.error(f"Failed to connect Milvus: {e}")
|