health-probes: clear stale results on start/restart, fast 10s probing until healthy

- Clear HealthProbe on StartStack/RestartStack so stale unhealthy state
  isn't re-applied by RefreshStatus
- Use 10s probe interval for unhealthy/new stacks (nil HealthProbe probes
  immediately on next tick), switch to normal 5m interval once healthy
- Scheduler frequency 1m → 10s to support fast probing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-25 14:59:25 +01:00
parent db83db383c
commit 2e9634e50f
3 changed files with 29 additions and 4 deletions
+11 -3
View File
@@ -33,10 +33,18 @@ func (m *Manager) RunHealthProbes() error {
continue
}
// Check if interval has elapsed since last probe
// Check if interval has elapsed since last probe.
// Fast 10s probes until healthy, then normal interval (default 5m).
// When HealthProbe is nil (just started/restarted), probe immediately.
interval := parseInterval(hc.Interval)
if stack.HealthProbe != nil && time.Since(stack.HealthProbe.LastCheck) < interval {
continue
if stack.HealthProbe != nil {
effectiveInterval := interval
if !stack.HealthProbe.Healthy {
effectiveInterval = 10 * time.Second
}
if time.Since(stack.HealthProbe.LastCheck) < effectiveInterval {
continue
}
}
// Find the main container to probe (matching stack name)