fix(init_data): getConfig 接收应用根目录非 config 文件路径(修复 NotADirectoryError)

This commit is contained in:
yumoqing 2026-08-16 21:28:31 +08:00
parent e5427d9516
commit da41f6be1b

View File

@ -89,10 +89,8 @@ SDLC_PROBLEM_TYPES = [
async def init_data(demo=False):
config_file = os.path.join(ROOT_DIR, 'conf', 'config.json')
if not os.path.exists(config_file):
config_file = os.path.join(ROOT_DIR, '..', 'conf', 'config.json')
config = getConfig(config_file, NS={'workdir': ROOT_DIR, 'ProgramPath': ProgramPath()})
# getConfig 接收应用根目录(内部拼接 conf/config.json非 config 文件路径
config = getConfig(ROOT_DIR, NS={'workdir': ROOT_DIR, 'ProgramPath': ProgramPath()})
DBPools(config.databases)
initEnv()
env = ServerEnv()