(ttl time.Duration)
| 303 | } |
| 304 | |
| 305 | func (s *Server) peekFreshHealthSnapshot(ttl time.Duration) map[string]bool { |
| 306 | s.healthMu.Lock() |
| 307 | defer s.healthMu.Unlock() |
| 308 | if s.healthSnapshot != nil && time.Since(s.healthAt) < ttl { |
| 309 | return cloneBoolMap(s.healthSnapshot) |
| 310 | } |
| 311 | return nil |
| 312 | } |
| 313 | |
| 314 | // probeBackendHealth runs Health with per-backend timeouts independent of the caller context |
| 315 | // (e.g. short /infer request_timeout_ms must not cancel health probes). |
no test coverage detected