+28
−14
+28
−28
Loading
The previous fallback caught any exception from the whole server.run()
call, including ones raised late during Ctrl-C shutdown (the same
websocket close-race, this time from inside uvicorn's own teardown code).
That misread a shutdown-time error as "backend unavailable" and silently
restarted the entire server on the other ws implementation — re-running
every device's startup — right when the operator was trying to stop it.
Now the ws implementation is resolved via Config.load() (which only
imports/resolves protocol classes, no socket bound, no before_serving
hooks touched) before Server(config).run() is ever called. Only a
Config.load() failure triggers the next backend in the list; anything
after that point behaves as before (KeyboardInterrupt handled, anything
else propagates).
Also includes minor UI tweaks (control.html/init.html widget ordering
and defaults).
Co-Authored-By:
Claude Sonnet 5 <noreply@anthropic.com>