mirror of
https://github.com/thecodingrobot/echoip.git
synced 2026-05-09 00:04:23 +02:00
main now uses signal.NotifyContext to cancel a root context on SIGINT or SIGTERM. Both the public and debug listeners share that context; on cancellation each calls srv.Shutdown with a 30s timeout to drain in-flight requests before exiting. If either listener fails the other is signalled to shut down too, and the process exits 1. Bad CLI args now exit 2 (was 0). Adds TestGracefulShutdown which fires a slow request, cancels the context mid-flight, and asserts the request completes successfully and the server returns nil. |
||
|---|---|---|
| .. | ||
| cache.go | ||
| cache_test.go | ||
| error.go | ||
| http.go | ||
| http_test.go | ||