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() {
|
if !cfgnew.ApplicationConfiguration.RPC.StartWhenSynchronized || serv.IsInSync() {
|
||||||
rpcServer.Start()
|
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
|
cfg = cfgnew
|
||||||
case <-grace.Done():
|
case <-grace.Done():
|
||||||
|
|
|
@ -31,6 +31,9 @@ func (ms *Service) Start() {
|
||||||
|
|
||||||
// ShutDown stops the service.
|
// ShutDown stops the service.
|
||||||
func (ms *Service) ShutDown() {
|
func (ms *Service) ShutDown() {
|
||||||
|
if !ms.config.Enabled {
|
||||||
|
return
|
||||||
|
}
|
||||||
ms.log.Info("shutting down service", zap.String("endpoint", ms.Addr))
|
ms.log.Info("shutting down service", zap.String("endpoint", ms.Addr))
|
||||||
err := ms.Shutdown(context.Background())
|
err := ms.Shutdown(context.Background())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue