mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-31 06:03:06 +02:00
fix(config): nil panic introduced in ff934a4bb2911f5fa3c23d8fe6fea252d881fdc3; remove duplicated log
This commit is contained in:
@@ -74,15 +74,7 @@ func NewMonitor(r types.Route) types.HealthMonCheck {
|
||||
}
|
||||
|
||||
func newMonitor(u *url.URL, cfg types.HealthCheckConfig, healthCheckFunc HealthCheckFunc) *monitor {
|
||||
state := config.WorkingState.Load()
|
||||
if state == nil {
|
||||
state = config.ActiveState.Load()
|
||||
}
|
||||
if state != nil {
|
||||
cfg.ApplyDefaults(state.Value().Defaults.HealthCheck)
|
||||
} else {
|
||||
cfg.ApplyDefaults(types.HealthCheckConfig{}) // use config defaults
|
||||
}
|
||||
cfg.ApplyDefaults(config.WorkingState.Load().Value().Defaults.HealthCheck)
|
||||
mon := &monitor{
|
||||
config: cfg,
|
||||
checkHealth: healthCheckFunc,
|
||||
|
||||
Reference in New Issue
Block a user