mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-27 19:41:11 +01:00
fixed healthcheck failed to disable and nil dereference
This commit is contained in:
@@ -64,5 +64,5 @@ func UseIdleWatcher(entry Entry) bool {
|
||||
|
||||
func UseHealthCheck(entry Entry) bool {
|
||||
hc := entry.HealthCheckConfig()
|
||||
return hc != nil && !hc.Disabled
|
||||
return hc != nil && !hc.Disable
|
||||
}
|
||||
|
||||
@@ -126,15 +126,15 @@ func (e *RawEntry) FillMissingFields() {
|
||||
e.HealthCheck = new(health.HealthCheckConfig)
|
||||
}
|
||||
|
||||
if e.HealthCheck.Disabled {
|
||||
if e.HealthCheck.Interval == 0 {
|
||||
e.HealthCheck.Interval = common.HealthCheckIntervalDefault
|
||||
}
|
||||
if e.HealthCheck.Timeout == 0 {
|
||||
e.HealthCheck.Timeout = common.HealthCheckTimeoutDefault
|
||||
}
|
||||
|
||||
if e.HealthCheck.Disable {
|
||||
e.HealthCheck = nil
|
||||
} else {
|
||||
if e.HealthCheck.Interval == 0 {
|
||||
e.HealthCheck.Interval = common.HealthCheckIntervalDefault
|
||||
}
|
||||
if e.HealthCheck.Timeout == 0 {
|
||||
e.HealthCheck.Timeout = common.HealthCheckTimeoutDefault
|
||||
}
|
||||
}
|
||||
|
||||
if cont.IdleTimeout != "" {
|
||||
|
||||
Reference in New Issue
Block a user