refactor: 重构配置模块
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
from fastapi import HTTPException
|
||||
from rich.traceback import install
|
||||
from src.config.config import BotConfig
|
||||
from src.config.config import Config
|
||||
from src.common.logger_manager import get_logger
|
||||
import os
|
||||
|
||||
@@ -14,8 +14,8 @@ async def reload_config():
|
||||
from src.config import config as config_module
|
||||
|
||||
logger.debug("正在重载配置文件...")
|
||||
bot_config_path = os.path.join(BotConfig.get_config_dir(), "bot_config.toml")
|
||||
config_module.global_config = BotConfig.load_config(config_path=bot_config_path)
|
||||
bot_config_path = os.path.join(Config.get_config_dir(), "bot_config.toml")
|
||||
config_module.global_config = Config.load_config(config_path=bot_config_path)
|
||||
logger.debug("配置文件重载成功")
|
||||
return {"status": "reloaded"}
|
||||
except FileNotFoundError as e:
|
||||
|
||||
Reference in New Issue
Block a user