최대 1분 후에 종료
This commit is contained in:
@ -132,7 +132,8 @@ func (server *Server) shutdown() {
|
|||||||
logger.Println("http server shutdown. healthcheckcounter :", t)
|
logger.Println("http server shutdown. healthcheckcounter :", t)
|
||||||
atomic.StoreInt64(&healthcheckcounter, math.MinInt64)
|
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)
|
next := atomic.LoadInt64(&healthcheckcounter)
|
||||||
if next == t {
|
if next == t {
|
||||||
cnt++
|
cnt++
|
||||||
@ -141,6 +142,7 @@ func (server *Server) shutdown() {
|
|||||||
cnt = 0
|
cnt = 0
|
||||||
}
|
}
|
||||||
time.Sleep(100 * time.Millisecond)
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
timer--
|
||||||
}
|
}
|
||||||
logger.Println("http server shutdown. healthcheck completed")
|
logger.Println("http server shutdown. healthcheck completed")
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user