MCPcopy Create free account
hub / github.com/devfeel/dotweb / ReSetConfig

Method ReSetConfig

dotweb.go:333–348  ·  view source on GitHub ↗

ReSetConfig reset config for app only apply when app is running Port can not be modify if EnabledPProf, EnabledPProf flag and PProfPort can not be modify

(config *config.Config)

Source from the content-addressed store, hash-verified

331// Port can not be modify
332// if EnabledPProf, EnabledPProf flag and PProfPort can not be modify
333func (app *DotWeb) ReSetConfig(config *config.Config) {
334 if !app.isRun {
335 app.Logger().Debug("DotWeb is not running, ReSetConfig can not be call", LogTarget_HttpServer)
336 return
337 }
338
339 config.Server.Port = app.Config.Server.Port
340 if app.Config.App.EnabledPProf {
341 config.App.PProfPort = app.Config.App.PProfPort
342 config.App.EnabledPProf = app.Config.App.EnabledPProf
343 }
344 app.Config = config
345 app.appLog = logger.NewAppLog()
346 app.initAppConfig()
347 app.Logger().Debug("DotWeb ReSetConfig is done.", LogTarget_HttpServer)
348}
349
350// StartServer start server with http port
351// if config the pprof, will be start pprof server

Callers 1

visitMethod · 0.80

Calls 4

LoggerMethod · 0.95
initAppConfigMethod · 0.95
NewAppLogFunction · 0.92
DebugMethod · 0.65

Tested by

no test coverage detected