From 4f3dc207a46a29edd0f36b9242ce59a6c7e104d0 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Wed, 28 Feb 2018 18:19:37 -0800 Subject: plugin/file: shutdown reload goroutine (#1571) * plugin/file: shutdown reload goroutine Shutdown the z.Reload() routine (if started in the first place) on shutdow and reload. Fixes #1508 * Must be put in c.OnShutdown() * up test coverage --- plugin/file/setup.go | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'plugin/file/setup.go') diff --git a/plugin/file/setup.go b/plugin/file/setup.go index 5f55eebe3..6f83ea9f3 100644 --- a/plugin/file/setup.go +++ b/plugin/file/setup.go @@ -38,6 +38,10 @@ func setup(c *caddy.Controller) error { return nil }) } + for _, n := range zones.Names { + z := zones.Z[n] + c.OnShutdown(z.OnShutdown) + } dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler { return File{Next: next, Zones: zones} -- cgit v1.2.3