fix(init_data): getConfig 接收应用根目录非 config 文件路径(修复 NotADirectoryError)
This commit is contained in:
parent
e5427d9516
commit
da41f6be1b
@ -89,10 +89,8 @@ SDLC_PROBLEM_TYPES = [
|
|||||||
|
|
||||||
|
|
||||||
async def init_data(demo=False):
|
async def init_data(demo=False):
|
||||||
config_file = os.path.join(ROOT_DIR, 'conf', 'config.json')
|
# getConfig 接收应用根目录(内部拼接 conf/config.json),非 config 文件路径
|
||||||
if not os.path.exists(config_file):
|
config = getConfig(ROOT_DIR, NS={'workdir': ROOT_DIR, 'ProgramPath': ProgramPath()})
|
||||||
config_file = os.path.join(ROOT_DIR, '..', 'conf', 'config.json')
|
|
||||||
config = getConfig(config_file, NS={'workdir': ROOT_DIR, 'ProgramPath': ProgramPath()})
|
|
||||||
DBPools(config.databases)
|
DBPools(config.databases)
|
||||||
initEnv()
|
initEnv()
|
||||||
env = ServerEnv()
|
env = ServerEnv()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user