x
This commit is contained in:
@@ -4,6 +4,7 @@ import importlib
|
||||
from shared.config.settings import settings
|
||||
from shared.utils.logger import get_logger
|
||||
from moldinsight.api.route_registry import route_load_status
|
||||
from moldinsight.api.html_report_router import include_into as include_html_report
|
||||
|
||||
logger = get_logger(__name__)
|
||||
|
||||
@@ -54,3 +55,15 @@ def _safe_include(label: str, module_path: str, debug_only: bool = False):
|
||||
|
||||
for _label, _module_path, _debug_only in ROUTE_MODULES:
|
||||
_safe_include(_label, _module_path, _debug_only)
|
||||
|
||||
|
||||
def register_moldinsight_routers(app):
|
||||
"""注册 moldinsight 全部业务路由到 app(D3 收敛:入口侧单点调用)。
|
||||
|
||||
- /api 聚合路由:各子路由模块装载失败经 ROUTE_MODULES/route_load_status 呈现
|
||||
(/api/health degraded,DEBUG fail-fast),见 _safe_include
|
||||
- HTML 报告代理挂根路径 /html/{filename}(URL 形状与原 StaticFiles 一致),
|
||||
失败同样登记 route_load_status(html_report_router.include_into)
|
||||
"""
|
||||
app.include_router(router, prefix="/api")
|
||||
include_html_report(app)
|
||||
|
||||
@@ -36,6 +36,15 @@ async def init_rustfs_storage():
|
||||
return False
|
||||
|
||||
|
||||
async def rustfs_startup_hook():
|
||||
"""app_factory startup_hooks 注入点(D3 收敛):moldinsight/unified 入口把
|
||||
本钩子传入 create_app(startup_hooks=[rustfs_startup_hook]),RustFS 连接接线
|
||||
归属 moldinsight 层,平台工厂不再持有模块专属依赖(原 connect_rustfs 已移除)。
|
||||
"""
|
||||
ok = await init_rustfs_storage()
|
||||
print(f"[{'OK' if ok else 'WARN'}] RustFS")
|
||||
|
||||
|
||||
async def test_storage():
|
||||
"""测试 RustFS 对象存储功能"""
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user