From fd4b7d8879df634464bd4acafe27ba48ba1fa4d1 Mon Sep 17 00:00:00 2001 From: Julien Balestra Date: Fri, 18 Dec 2020 23:08:59 +0100 Subject: [PATCH] setup: on shutdown, close the client connection --- setup.go | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.go b/setup.go index ee057ae..8e35436 100644 --- a/setup.go +++ b/setup.go @@ -40,6 +40,7 @@ func setup(c *caddy.Controller) error { fmt.Errorf("error constructing wgctrl client: %v", err)) } + c.OnFinalShutdown(client.Close) // Add the Plugin to CoreDNS, so Servers can use it in their plugin chain. dnsserver.GetConfig(c).AddPlugin(func(next plugin.Handler) plugin.Handler {