3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-15 08:29:31 +01:00

remove unnecessary indirection in config

This commit is contained in:
Shivaram Lingamneni 2021-09-19 02:09:43 -04:00
parent e0e4791f72
commit 2cae19dde5
2 changed files with 2 additions and 5 deletions

View File

@ -650,7 +650,7 @@ type Config struct {
Debug struct { Debug struct {
RecoverFromErrors *bool `yaml:"recover-from-errors"` RecoverFromErrors *bool `yaml:"recover-from-errors"`
recoverFromErrors bool recoverFromErrors bool
PprofListener *string `yaml:"pprof-listener"` PprofListener string `yaml:"pprof-listener"`
} }
Limits Limits Limits Limits

View File

@ -733,10 +733,7 @@ func (server *Server) applyConfig(config *Config) (err error) {
} }
func (server *Server) setupPprofListener(config *Config) { func (server *Server) setupPprofListener(config *Config) {
pprofListener := "" pprofListener := config.Debug.PprofListener
if config.Debug.PprofListener != nil {
pprofListener = *config.Debug.PprofListener
}
if server.pprofServer != nil { if server.pprofServer != nil {
if pprofListener == "" || (pprofListener != server.pprofServer.Addr) { if pprofListener == "" || (pprofListener != server.pprofServer.Addr) {
server.logger.Info("server", "Stopping pprof listener", server.pprofServer.Addr) server.logger.Info("server", "Stopping pprof listener", server.pprofServer.Addr)