mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
middleware/metrics: survive restart (#542)
* middleware/metrics: survive restart Keep the handler running during restart. Stopping and starting the handler results in "address in use" - sometimes, meaning the reload will be flaky. In turn this behavior means any changes to the monitor stanza are not picked up. * remove resync
This commit is contained in:
@@ -28,9 +28,10 @@ func setup(c *caddy.Controller) error {
|
||||
return m
|
||||
})
|
||||
|
||||
// During restarts we will keep this handler running.
|
||||
metricsOnce.Do(func() {
|
||||
c.OnStartup(m.OnStartup)
|
||||
c.OnShutdown(m.OnShutdown)
|
||||
c.OncePerServerBlock(m.OnStartup)
|
||||
c.OnFinalShutdown(m.OnShutdown)
|
||||
})
|
||||
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user