mirror of
https://relay.ngit.dev/npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/ngit-grasp.git
synced 2026-10-05 23:18:24 +00:00
Each metrics scrape traverses repository directories and encodes the response synchronously. Slow filesystem metadata operations could occupy a worker that also serves WebSocket and Git requests. Render on a blocking worker. Acquire a shared permit before spawning it and keep that permit inside the worker even if the HTTP request is canceled, so concurrent scrapes cannot start overlapping directory scans. Report a worker failure as an HTTP 500 response rather than losing the request task. Preserve the synchronous rendering API, metric contents and monitoring configuration. This does not cache metrics or claim a measured production speedup; it prevents scrape work from running on the async executor. Validation: a current-thread test checks that a queued scrape yields, capacity is released and async rendering preserves repository counts.