mirror of
https://github.com/caddyserver/caddy.git
synced 2026-06-28 04:41:41 +00:00
Merge ed225048ff into 13a4c3f43c
This commit is contained in:
commit
efd586563f
1 changed files with 2 additions and 2 deletions
|
|
@ -476,7 +476,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, networ
|
|||
if upstream.Host.activeHealthFails() >= h.HealthChecks.Active.Fails {
|
||||
// dispatch an event that the host newly became unhealthy
|
||||
if upstream.setHealthy(false) {
|
||||
h.events.Emit(h.ctx, "unhealthy", map[string]any{"host": hostAddr})
|
||||
h.events.Emit(h.ctx, "unhealthy", map[string]any{"host": hostAddr, "addr": networkAddr})
|
||||
upstream.Host.resetHealth()
|
||||
}
|
||||
}
|
||||
|
|
@ -499,7 +499,7 @@ func (h *Handler) doActiveHealthCheck(dialInfo DialInfo, hostAddr string, networ
|
|||
if c := h.HealthChecks.Active.logger.Check(zapcore.InfoLevel, "host is up"); c != nil {
|
||||
c.Write(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, "addr": networkAddr})
|
||||
upstream.Host.resetHealth()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue