fix 优先加载子模块
This commit is contained in:
parent
882da68903
commit
7ed194a62c
@ -83,10 +83,10 @@ class ModuleHelper:
|
|||||||
not name.startswith('_') and isinstance(obj, type)]
|
not name.startswith('_') and isinstance(obj, type)]
|
||||||
# 确定是否需要重新加载
|
# 确定是否需要重新加载
|
||||||
if any(filter_func(name, obj) for name, obj in candidates):
|
if any(filter_func(name, obj) for name, obj in candidates):
|
||||||
submodules.extend(reload_module_objects(module))
|
|
||||||
# 如果子模块是包,重新加载其子模块
|
# 如果子模块是包,重新加载其子模块
|
||||||
if is_pkg:
|
if is_pkg:
|
||||||
reload_sub_modules(module, full_package_name)
|
reload_sub_modules(module, full_package_name)
|
||||||
|
submodules.extend(reload_module_objects(module))
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
logger.debug(f'加载模块 {package_name} 失败:{str(err)} - {traceback.format_exc()}')
|
logger.debug(f'加载模块 {package_name} 失败:{str(err)} - {traceback.format_exc()}')
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user