hotfix(health): info log on healthcheck passing after failure

This commit is contained in:
Quentin McGaw
2025-10-23 18:58:19 +00:00
parent cf756f561a
commit 9803fa1cfd

View File

@@ -87,10 +87,6 @@ func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-c
return return
case healthErr := <-healthErrCh: case healthErr := <-healthErrCh:
l.healthServer.SetError(healthErr) l.healthServer.SetError(healthErr)
if previousHealthErr != nil && healthErr == nil {
l.logger.Info("healthcheck passed successfully after previous failure(s)")
continue
}
if healthErr != nil { if healthErr != nil {
if *l.healthSettings.RestartVPN { if *l.healthSettings.RestartVPN {
// Note this restart call must be done in a separate goroutine // Note this restart call must be done in a separate goroutine
@@ -101,6 +97,8 @@ func (l *Loop) collectHealthErrors(ctx, loopCtx context.Context, healthErrCh <-c
} }
l.logger.Warnf("healthcheck failed: %s", healthErr) l.logger.Warnf("healthcheck failed: %s", healthErr)
l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md") l.logger.Info("👉 See https://github.com/qdm12/gluetun-wiki/blob/main/faq/healthcheck.md")
} else if previousHealthErr != nil {
l.logger.Info("healthcheck passed successfully after previous failure(s)")
} }
previousHealthErr = healthErr previousHealthErr = healthErr
} }