fix readiness router health contract

This commit is contained in:
kami
2026-07-26 20:49:21 +04:00
parent f748be194a
commit 18e35bcd45
2 changed files with 42 additions and 3 deletions
+2 -3
View File
@@ -67,10 +67,9 @@ func (s *Server) authorize(r *http.Request) error {
}
func (s *Server) Readiness(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
checks := []Probe{{Name: "store", Ready: s.Store != nil}}
if s.RouterReady {
checks = append(checks, Probe{Name: "router", Ready: true})
}
checks = append(checks, Probe{Name: "router", Ready: s.RouterReady})
for name, probe := range s.Probes {
ok, detail := probe()
checks = append(checks, Probe{Name: name, Ready: ok, Detail: detail})