Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -13,10 +13,11 @@ import argparse
|
||||
import sys
|
||||
import os
|
||||
|
||||
# 添加项目路径
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
# 添加 backend 到导入路径
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.insert(0, os.path.join(PROJECT_ROOT, "backend"))
|
||||
|
||||
from src.config.settings import settings
|
||||
from app.config.settings import settings
|
||||
from loguru import logger
|
||||
|
||||
|
||||
@@ -52,7 +53,7 @@ def clear_milvus(dry_run: bool = False):
|
||||
|
||||
# 重新创建collection(可选)
|
||||
logger.info("重新创建collection...")
|
||||
from src.services.storage.milvus_client import MilvusClient
|
||||
from app.services.storage.milvus_client import MilvusClient
|
||||
client = MilvusClient()
|
||||
client.connect()
|
||||
client.create_collection(recreate=True)
|
||||
@@ -190,4 +191,4 @@ def main():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main())
|
||||
sys.exit(main())
|
||||
|
||||
Reference in New Issue
Block a user