mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
dont lameduck when reloading (#5472)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user