Stream beets imports over HTTP.

fix(server): add timeout and TTL cache to health endpoint #19

Merged glerp.sullen.net
targeting main from glerp.sullen.net/goosefoot:fix/health-timeout-cache
Merged opened by and assigned to glerp.sullen.net
targeting main from glerp.sullen.net/goosefoot:fix/health-timeout-cache

Summary #

  • Add DefaultHealthTimeout (5s) and DefaultHealthCacheTTL (30s) to server.Config, defaulting unset values in server.New and wiring them explicitly in cmd/goosefoot/main.go.
  • Serialize GET /health beet version checks behind a mutex, bounding subprocess execution with HealthTimeout and caching healthy version strings for HealthCacheTTL.
  • Skip caching errors so /health recovers immediately once beet is healthy while preventing concurrent check stampedes.
  • Add behavioral unit tests covering TTL cache hits, post-TTL refresh, error non-caching, and timeout context cancellation (503 Service Unavailable).
Commits 0