mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 10:10:08 -08:00
remove unnecessary indirection in config
This commit is contained in:
parent
e0e4791f72
commit
2cae19dde5
2 changed files with 2 additions and 5 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue