diff --git a/src/reachy_mini/daemon/app/main.py b/src/reachy_mini/daemon/app/main.py index e12feb98..ff6903ff 100644 --- a/src/reachy_mini/daemon/app/main.py +++ b/src/reachy_mini/daemon/app/main.py @@ -110,13 +110,12 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]: app.include_router(router) - if health_check_event is not None: - - @app.post("/health-check") - async def health_check() -> dict[str, str]: - """Health check endpoint to reset the health check timer.""" + @app.post("/health-check") + async def health_check() -> dict[str, str]: + """Health check endpoint to reset the health check timer.""" + if health_check_event is not None: health_check_event.set() - return {"status": "ok"} + return {"status": "ok"} app.add_middleware( CORSMiddleware,