dont lameduck when reloading (#5472)

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver
2022-07-06 13:52:18 -04:00
committed by GitHub
parent a6078ddba3
commit d903a963ee
2 changed files with 13 additions and 1 deletions

View File

@@ -70,3 +70,15 @@ func (h *health) OnFinalShutdown() error {
h.nlSetup = false
return nil
}
func (h *health) OnReload() error {
if !h.nlSetup {
return nil
}
h.stop()
h.ln.Close()
h.nlSetup = false
return nil
}

View File

@@ -20,7 +20,7 @@ func setup(c *caddy.Controller) error {
h := &health{Addr: addr, lameduck: lame}
c.OnStartup(h.OnStartup)
c.OnRestart(h.OnFinalShutdown)
c.OnRestart(h.OnReload)
c.OnFinalShutdown(h.OnFinalShutdown)
c.OnRestartFailed(h.OnStartup)