fix(workspace): workspace_tree 提前在 async with 块内读 apps/modules,修复 sor 关闭后 get_project_apps_modules 返回空导致引用节点不显示
This commit is contained in:
parent
9ec2ad473d
commit
32a8377a4c
@ -15,6 +15,8 @@ dbname = get_module_dbname('pipeline-sdlc')
|
||||
async with DBPools().sqlorContext(dbname) as sor:
|
||||
project_dir, _ = await get_project_dir(sor, uid, session_id)
|
||||
space_dir, _ = await get_space_dir(sor, uid, session_id)
|
||||
# 提前读出项目用到的 apps/modules(sor 在块内有效,块外调用会因 sor 关闭返回空)
|
||||
_apps, _modules = await get_project_apps_modules(sor, uid, session_id)
|
||||
|
||||
if not project_dir or not os.path.isdir(project_dir):
|
||||
if not node_id:
|
||||
@ -56,7 +58,7 @@ items = []
|
||||
|
||||
# 根节点:额外挂项目用到的 apps 子目录 + modules 子目录
|
||||
if extra_children:
|
||||
apps, modules = await get_project_apps_modules(sor, uid, session_id)
|
||||
apps, modules = _apps, _modules
|
||||
for app in apps:
|
||||
app_path = os.path.join(space_dir, 'apps', app)
|
||||
if os.path.isdir(app_path):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user