fix(config): fix default values not applied

This commit is contained in:
yusing
2025-12-16 11:55:47 +08:00
parent db0cbc6577
commit ff934a4bb2
5 changed files with 26 additions and 4 deletions

View File

@@ -36,6 +36,9 @@ func (hc *HealthCheckConfig) ApplyDefaults(defaults HealthCheckConfig) {
}
}
if hc.Retries == 0 {
hc.Retries = int64(HealthCheckDownNotifyDelayDefault / hc.Interval)
hc.Retries = defaults.Retries
if hc.Retries == 0 {
hc.Retries = max(1, int64(HealthCheckDownNotifyDelayDefault/hc.Interval))
}
}
}