mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-22 09:29:38 +00:00
cli: restart pprof and prometheus on HUP
This commit is contained in:
parent
6593b94594
commit
df24c1268e
2 changed files with 9 additions and 0 deletions
|
@ -551,6 +551,12 @@ Main:
|
|||
if !cfgnew.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() {
|
||||
rpcServer.Start()
|
||||
}
|
||||
pprof.ShutDown()
|
||||
pprof = metrics.NewPprofService(cfgnew.ApplicationConfiguration.Pprof, log)
|
||||
go pprof.Start()
|
||||
prometheus.ShutDown()
|
||||
prometheus = metrics.NewPrometheusService(cfgnew.ApplicationConfiguration.Prometheus, log)
|
||||
go prometheus.Start()
|
||||
}
|
||||
cfg = cfgnew
|
||||
case <-grace.Done():
|
||||
|
|
|
@ -31,6 +31,9 @@ func (ms *Service) Start() {
|
|||
|
||||
// ShutDown stops the service.
|
||||
func (ms *Service) ShutDown() {
|
||||
if !ms.config.Enabled {
|
||||
return
|
||||
}
|
||||
ms.log.Info("shutting down service", zap.String("endpoint", ms.Addr))
|
||||
err := ms.Shutdown(context.Background())
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue