1
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-16 21:56:40 -05:00

reverseproxy: Only log host is up status on change (fixes #6415) (#6419)

This commit is contained in:
klaxa 2024-07-03 21:05:52 +02:00 committed by GitHub
parent 0287009ee5
commit f350e001b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -426,6 +426,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, upstre
} }
if upstream.Host.activeHealthPasses() >= h.HealthChecks.Active.Passes { if upstream.Host.activeHealthPasses() >= h.HealthChecks.Active.Passes {
if upstream.setHealthy(true) { if upstream.setHealthy(true) {
h.HealthChecks.Active.logger.Info("host is up", zap.String("host", hostAddr))
h.events.Emit(h.ctx, "healthy", map[string]any{"host": hostAddr}) h.events.Emit(h.ctx, "healthy", map[string]any{"host": hostAddr})
upstream.Host.resetHealth() upstream.Host.resetHealth()
} }
@ -492,7 +493,6 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, upstre
} }
// passed health check parameters, so mark as healthy // passed health check parameters, so mark as healthy
h.HealthChecks.Active.logger.Info("host is up", zap.String("host", hostAddr))
markHealthy() markHealthy()
return nil return nil