From abcfd24138cae8645a83f7e4fc37fd273bd8e9a8 Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Thu, 23 Mar 2023 13:20:36 +0300 Subject: [PATCH] chan os.Signal should be buffered --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e0670d7..c14906f 100644 --- a/main.go +++ b/main.go @@ -274,8 +274,8 @@ func main() { } ln = netutil.LimitListener(ln, *MaxClients) - needsShutdown := make(chan os.Signal, 0) - exitErr := make(chan error, 0) + needsShutdown := make(chan os.Signal, 1) + exitErr := make(chan error) signal.Notify(needsShutdown, syscall.SIGTERM, syscall.SIGINT) go func(s *http.Server) { <-needsShutdown -- 2.44.0