File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -142,11 +142,12 @@ async def healthcheck(request: Request):
142142 return JSONResponse ({"message" : "Error" }, status_code = 503 )
143143 from lightllm .utils .health_check import health_check , health_obj
144144
145- asyncio .create_task (health_check (g_objs .args , g_objs .httpserver_manager , None ))
146- if health_obj .is_health ():
147- return JSONResponse ({"message" : "Ok" }, status_code = 200 )
148- else :
149- return JSONResponse ({"message" : "Error" }, status_code = 503 )
145+ health_task = asyncio .create_task (health_check (g_objs .args , g_objs .httpserver_manager , None ))
146+ if not health_obj .is_health ():
147+ await health_task
148+ return JSONResponse (
149+ {"message" : "Ok" if health_obj .is_health () else "Error" }, status_code = 200 if health_obj .is_health () else 503
150+ )
150151
151152
152153@app .get ("/token_load" , summary = "Get the current server's load of tokens" )
You can’t perform that action at this time.
0 commit comments