mirror of
https://github.com/lynchaos/ashvale-station.git
synced 2026-09-12 12:47:49 +00:00
Shutdown hang, the cause of every restart taking systemd's full 90 s timeout and ending in SIGKILL: /api/stream looped forever with no disconnect or shutdown check, so an open dashboard was an in-flight request that never completed and uvicorn's graceful shutdown waited on it. Reproduced cleanly: with no stream client the process stopped in 2 s, with one open client it was still running after 15 s. Fixed by bounding timeout_graceful_shutdown, and by having the generator exit on client disconnect and on a shutdown event. Now 7 s with a client attached. Equations rendered as blank boxes whenever the KaTeX CDN was unreachable, which is a real case for a Pi on wifi. The elements carried the TeX only in a data attribute, so with no KaTeX there was nothing to display. The source is now written into the element as text first and KaTeX replaces it, so it degrades to readable TeX. Verified by aborting the katex request. A window load handler re-runs typesetting for a slow CDN. The code comment claiming this fallback already existed was wrong and is corrected.