From f9a146321cdbce194dd0b09c5059e894a1963158 Mon Sep 17 00:00:00 2001 From: mountain Date: Tue, 12 Sep 2023 16:59:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B5=9C=EB=8C=80=201=EB=B6=84=20=ED=9B=84?= =?UTF-8?q?=EC=97=90=20=EC=A2=85=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.go b/server.go index aa73093..5fbf3c9 100644 --- a/server.go +++ b/server.go @@ -132,7 +132,8 @@ func (server *Server) shutdown() { logger.Println("http server shutdown. healthcheckcounter :", t) atomic.StoreInt64(&healthcheckcounter, math.MinInt64) - for cnt := 0; cnt < 100; { + timer := 600 // 0.1 * 600 = 1분 + for cnt := 0; cnt < 100 && timer > 0; { next := atomic.LoadInt64(&healthcheckcounter) if next == t { cnt++ @@ -141,6 +142,7 @@ func (server *Server) shutdown() { cnt = 0 } time.Sleep(100 * time.Millisecond) + timer-- } logger.Println("http server shutdown. healthcheck completed") } else {