Refactor how to handle sigterm and nginx process goroutine (#4959)
This commit is contained in:
parent
12aa72622a
commit
66ef05849f
2 changed files with 10 additions and 10 deletions
|
|
@ -125,23 +125,22 @@ func main() {
|
|||
}
|
||||
mc.Start()
|
||||
|
||||
ngx := controller.NewNGINXController(conf, mc)
|
||||
go handleSigterm(ngx, func(code int) {
|
||||
os.Exit(code)
|
||||
})
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
if conf.EnableProfiling {
|
||||
go registerProfiler()
|
||||
}
|
||||
|
||||
ngx := controller.NewNGINXController(conf, mc)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
registerHealthz(nginx.HealthPath, ngx, mux)
|
||||
registerMetrics(reg, mux)
|
||||
|
||||
go startHTTPServer(conf.ListenPorts.Health, mux)
|
||||
go ngx.Start()
|
||||
|
||||
ngx.Start()
|
||||
handleSigterm(ngx, func(code int) {
|
||||
os.Exit(code)
|
||||
})
|
||||
}
|
||||
|
||||
type exiter func(code int)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue