diff --git a/backend/main.py b/backend/main.py index d6f743d..ac1cf95 100644 --- a/backend/main.py +++ b/backend/main.py @@ -76,8 +76,12 @@ async def main(): "NO USERS CONFIGURED — the API is OPEN (anonymous admin). " "Create one: venv\\Scripts\\python -m backend.users add --scopes admin" ) + # timeout_graceful_shutdown: the charger holds its WebSocket open FOREVER, + # so a graceful "wait for connections to drain" would hang Ctrl+C — cap it. + # The charger reconnects within seconds after a restart anyway. await uvicorn.Server( - uvicorn.Config(app, host="0.0.0.0", port=9000, log_config=None) + uvicorn.Config(app, host="0.0.0.0", port=9000, log_config=None, + timeout_graceful_shutdown=3) ).serve()