mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 16:58:31 +02:00
fix(healthcheck): nil panic on agents
This commit is contained in:
committed by
github-actions[bot]
parent
9bdf847f56
commit
679b02f790
@@ -74,7 +74,11 @@ func NewMonitor(r types.Route) types.HealthMonCheck {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newMonitor(u *url.URL, cfg types.HealthCheckConfig, healthCheckFunc HealthCheckFunc) *monitor {
|
func newMonitor(u *url.URL, cfg types.HealthCheckConfig, healthCheckFunc HealthCheckFunc) *monitor {
|
||||||
cfg.ApplyDefaults(config.WorkingState.Load().Value().Defaults.HealthCheck)
|
if state := config.WorkingState.Load().Value(); state != nil {
|
||||||
|
cfg.ApplyDefaults(state.Defaults.HealthCheck)
|
||||||
|
} else {
|
||||||
|
cfg.ApplyDefaults(types.HealthCheckConfig{}) // use defaults from constants
|
||||||
|
}
|
||||||
mon := &monitor{
|
mon := &monitor{
|
||||||
config: cfg,
|
config: cfg,
|
||||||
checkHealth: healthCheckFunc,
|
checkHealth: healthCheckFunc,
|
||||||
|
|||||||
Reference in New Issue
Block a user