修改适配Linux
This commit is contained in:
+1
-8
@@ -6,8 +6,7 @@ from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI, Request
|
||||
|
||||
from app.utils.api_deps import get_rainfall_model, get_earthquake_model, is_model_loaded
|
||||
from app.schemas.api_schemas import HealthResponse
|
||||
from app.utils.api_deps import get_rainfall_model, get_earthquake_model
|
||||
from app.config.paths import get_logger
|
||||
from config import settings
|
||||
|
||||
@@ -64,10 +63,4 @@ def create_app() -> FastAPI:
|
||||
from app.api import register_routers
|
||||
register_routers(application)
|
||||
|
||||
@application.get("/health", response_model=HealthResponse, tags=["系统"])
|
||||
async def health_check():
|
||||
"""健康检查"""
|
||||
status = is_model_loaded()
|
||||
return HealthResponse(status="ok", **status)
|
||||
|
||||
return application
|
||||
|
||||
Reference in New Issue
Block a user