Toggle /ping to artificially return unhealthy response on SIGTERM during requestAcceptGraceTimeout interval
This commit is contained in:
parent
9699dc2a85
commit
5792a19b97
5 changed files with 45 additions and 4 deletions
|
@ -212,6 +212,9 @@ func (s *Server) StartWithContext(ctx context.Context) {
|
|||
<-ctx.Done()
|
||||
log.Info("I have to go...")
|
||||
reqAcceptGraceTimeOut := time.Duration(s.globalConfiguration.LifeCycle.RequestAcceptGraceTimeout)
|
||||
if s.globalConfiguration.Ping != nil && reqAcceptGraceTimeOut > 0 {
|
||||
s.globalConfiguration.Ping.SetTerminating()
|
||||
}
|
||||
if reqAcceptGraceTimeOut > 0 {
|
||||
log.Infof("Waiting %s for incoming requests to cease", reqAcceptGraceTimeOut)
|
||||
time.Sleep(reqAcceptGraceTimeOut)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue