diff options
author | 2016-04-29 07:28:35 +0100 | |
---|---|---|
committer | 2016-04-29 07:28:35 +0100 | |
commit | 9e9d72655d865f2d136ad3b0439735cde53b679f (patch) | |
tree | f0c365ffb5fbe9599374ab2551463d610f79ebd6 /core/setup/pprof.go | |
parent | a1478f891dd6849835973720df6b5651a8ea88fd (diff) | |
download | coredns-9e9d72655d865f2d136ad3b0439735cde53b679f.tar.gz coredns-9e9d72655d865f2d136ad3b0439735cde53b679f.tar.zst coredns-9e9d72655d865f2d136ad3b0439735cde53b679f.zip |
Make middleware survive a restart (#142)
Make middleware that sets up a (http) handler survive a graceful
restart. We calls the middleware's Shutdown function(s). If restart
fails the Start function is called again.
* middleware/health: OK
* middleware/pprof: OK
* middleware/metrics: OK
All restart OK.
Diffstat (limited to 'core/setup/pprof.go')
-rw-r--r-- | core/setup/pprof.go | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/setup/pprof.go b/core/setup/pprof.go index e202bfc00..cf6b49636 100644 --- a/core/setup/pprof.go +++ b/core/setup/pprof.go @@ -27,6 +27,7 @@ func PProf(c *Controller) (middleware.Middleware, error) { handler := &pprof.Handler{} pprofOnce.Do(func() { c.Startup = append(c.Startup, handler.Start) + c.Shutdown = append(c.Shutdown, handler.Shutdown) }) return func(next middleware.Handler) middleware.Handler { |