fix(init_data): getConfig 改为无参单例调用(模块/脚本从 app 根目录运行,cwd 定位 conf)
This commit is contained in:
parent
f8c4b1bfd6
commit
7d7db4717c
@ -13,7 +13,6 @@ sys.path.insert(0, ROOT_DIR)
|
||||
|
||||
from sqlor.dbpools import DBPools
|
||||
from appPublic.jsonConfig import getConfig
|
||||
from appPublic.folderUtils import ProgramPath
|
||||
from appPublic.uniqueID import getID
|
||||
from ahserver.serverenv import ServerEnv
|
||||
from ahserver.globalEnv import initEnv
|
||||
@ -59,8 +58,8 @@ SDLC_STEPS = [
|
||||
|
||||
|
||||
async def init_data(demo=False):
|
||||
# getConfig 接收应用根目录(内部拼接 conf/config.json),非 config 文件路径
|
||||
config = getConfig(ROOT_DIR, NS={'workdir': ROOT_DIR, 'ProgramPath': ProgramPath()})
|
||||
# getConfig 单例无参:从 app 根目录运行(cwd),内部自动拼 conf/config.json
|
||||
config = getConfig()
|
||||
DBPools(config.databases)
|
||||
initEnv()
|
||||
env = ServerEnv()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user