mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
perf(startup): reduce readiness work (#6341)
This commit is contained in:
@@ -7,11 +7,16 @@ def init_routers(app: FastAPI):
|
||||
"""
|
||||
初始化路由
|
||||
"""
|
||||
from app.api.apiv1 import api_router
|
||||
from app.api.router_specs import API_V1_ROUTER_SPECS
|
||||
from app.api.servarr import arr_router
|
||||
from app.api.servcookie import cookie_router
|
||||
# API路由
|
||||
app.include_router(api_router, prefix=settings.API_V1_STR)
|
||||
# 直接聚合端点路由,避免先构建兼容路由器再克隆到最终应用。
|
||||
for spec in API_V1_ROUTER_SPECS:
|
||||
app.include_router(
|
||||
spec.router,
|
||||
prefix=f"{settings.API_V1_STR}{spec.prefix}",
|
||||
tags=list(spec.tags),
|
||||
)
|
||||
# Radarr、Sonarr路由
|
||||
app.include_router(arr_router, prefix="/api/v3")
|
||||
# CookieCloud路由
|
||||
|
||||
Reference in New Issue
Block a user