(request: Request)
| 142 | @app.get("/health", summary="Check server health") |
| 143 | @app.head("/health", summary="Check server health") |
| 144 | async def healthcheck(request: Request): |
| 145 | if g_objs.args.run_mode == "pd_master": |
| 146 | return JSONResponse({"message": "Ok"}, status_code=200) |
| 147 | |
| 148 | if os.environ.get("DEBUG_HEALTHCHECK_RETURN_FAIL") == "true": |
| 149 | return JSONResponse({"message": "Error"}, status_code=503) |
| 150 | from lightllm.utils.health_check import health_check, health_obj |
| 151 | |
| 152 | health_task = asyncio.create_task(health_check(g_objs.args, g_objs.httpserver_manager, None)) |
| 153 | if not health_obj.is_health(): |
| 154 | await health_task |
| 155 | return JSONResponse( |
| 156 | {"message": "Ok" if health_obj.is_health() else "Error"}, status_code=200 if health_obj.is_health() else 503 |
| 157 | ) |
| 158 | |
| 159 | |
| 160 | @app.get("/token_load", summary="Get the current server's load of tokens") |
nothing calls this directly
no test coverage detected