From e9f97d16fe3f5930cec601d46011717098372c10 Mon Sep 17 00:00:00 2001 From: zengxu Date: Thu, 16 May 2024 18:01:01 +0800 Subject: [PATCH] fix http server graceful shutdown --- cmd/picoshare/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/picoshare/main.go b/cmd/picoshare/main.go index d44c4a50..60f52fd1 100644 --- a/cmd/picoshare/main.go +++ b/cmd/picoshare/main.go @@ -61,7 +61,7 @@ func main() { httpSrv := http.Server{Addr: fmt.Sprintf(":%s", port), Handler: h} go func() { log.Printf("listening on %s", port) - log.Fatal(httpSrv.ListenAndServe()) + log.Printf("http server exit: %s", httpSrv.ListenAndServe()) }() <-stop ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)