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:
parent
e0e4791f72
commit
2cae19dde5
@ -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…
Reference in New Issue
Block a user