최대 1분 후에 종료

This commit is contained in:
2023-09-12 16:59:17 +09:00
parent ea8ae4d02c
commit f9a146321c

View File

@ -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 {