plugin/health : rework overloaded goroutine to support graceful shutdown (#5244)

Signed-off-by: Ondřej Benkovský <ondrej.benkovsky@jamf.com>
This commit is contained in:
Ondřej Benkovský
2022-04-13 19:09:03 +02:00
committed by GitHub
parent 068af64b19
commit a929b0b1ec
5 changed files with 63 additions and 12 deletions

View File

@@ -17,7 +17,7 @@ func setup(c *caddy.Controller) error {
return plugin.Error("health", err)
}
h := &health{Addr: addr, stop: make(chan bool), lameduck: lame}
h := &health{Addr: addr, lameduck: lame}
c.OnStartup(h.OnStartup)
c.OnRestart(h.OnFinalShutdown)