Skip nil client for health

This commit is contained in:
Viktor Liu
2026-02-12 18:23:11 +08:00
parent e531fb54b1
commit abaf061c2a

View File

@@ -340,6 +340,13 @@ func NewServer(addr string, checker *Checker, logger *log.Logger, metricsHandler
}
func checkClientHealth(client *embed.Client) ClientHealth {
if client == nil {
return ClientHealth{
Healthy: false,
Error: "client not initialized",
}
}
status, err := client.Status()
if err != nil {
return ClientHealth{