diff --git a/main.go b/main.go index 23c234c..41954f0 100644 --- a/main.go +++ b/main.go @@ -193,9 +193,7 @@ func main() { sig := <-c log.Printf("Received signal %v, shutting down...\n", sig) *stoppingPtr = true - // Create a deadline to wait for. - // Using the same value as the server's `WriteTimeout` would be great, because this would mean that every client could finish his request as he normally could. - // But `docker stop` only gives us 10 seconds. + // Create a deadline to wait for. `docker stop` gives us 10 seconds. // No need to get the cancel func and defer calling it, because srv.Shutdown() will consider the timeout from the context. ctx, _ := context.WithTimeout(context.Background(), 9*time.Second) // Doesn't block if no connections, but will otherwise wait until the timeout deadline