add parameter pprofPort to configure the port of the pprof listener

This commit is contained in:
aler9
2021-03-27 11:21:30 +01:00
parent fb0e900eb5
commit a57f3d04a7
4 changed files with 13 additions and 7 deletions

View File

@@ -183,6 +183,7 @@ func (p *program) createResources(initial bool) error {
if p.pprof == nil {
p.pprof, err = pprof.New(
p.conf.ListenIP,
p.conf.PprofPort,
p)
if err != nil {
return err
@@ -303,7 +304,8 @@ func (p *program) closeResources(newConf *conf.Conf) {
closePprof := false
if newConf == nil ||
newConf.Pprof != p.conf.Pprof ||
newConf.ListenIP != p.conf.ListenIP {
newConf.ListenIP != p.conf.ListenIP ||
newConf.PprofPort != p.conf.PprofPort {
closePprof = true
}