Fix generating pytest for training service 2
This commit is contained in:
@@ -220,6 +220,19 @@ async def get_metrics():
|
||||
return app.state.metrics_collector.get_metrics()
|
||||
return {"status": "metrics not available"}
|
||||
|
||||
@app.get("/health/live")
|
||||
async def liveness_check():
|
||||
return {"status": "alive"}
|
||||
|
||||
@app.get("/health/ready")
|
||||
async def readiness_check():
|
||||
ready = getattr(app.state, 'ready', True)
|
||||
return {"status": "ready" if ready else "not ready"}
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"service": "training-service", "version": "1.0.0"}
|
||||
|
||||
if __name__ == "__main__":
|
||||
uvicorn.run(
|
||||
"app.main:app",
|
||||
|
||||
Reference in New Issue
Block a user