aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugin/health/health.go12
-rw-r--r--plugin/health/setup.go2
2 files changed, 13 insertions, 1 deletions
diff --git a/plugin/health/health.go b/plugin/health/health.go
index a71c00c8c..c69b221ec 100644
--- a/plugin/health/health.go
+++ b/plugin/health/health.go
@@ -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
+}
diff --git a/plugin/health/setup.go b/plugin/health/setup.go
index 624d88dd5..e9163ad44 100644
--- a/plugin/health/setup.go
+++ b/plugin/health/setup.go
@@ -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)