mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 03:53:34 +08:00
Add healthy indicator for raft status
This commit is contained in:
@@ -26,6 +26,15 @@ func (s *RaftServer) StatusHandler(w http.ResponseWriter, r *http.Request) {
|
||||
writeJsonQuiet(w, r, http.StatusOK, ret)
|
||||
}
|
||||
|
||||
func (s *RaftServer) HealthzHandler(w http.ResponseWriter, r *http.Request) {
|
||||
_, err := s.topo.Leader()
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
} else {
|
||||
w.WriteHeader(http.StatusOK)
|
||||
}
|
||||
}
|
||||
|
||||
func (s *RaftServer) StatsRaftHandler(w http.ResponseWriter, r *http.Request) {
|
||||
if s.RaftHashicorp == nil {
|
||||
writeJsonQuiet(w, r, http.StatusNotFound, nil)
|
||||
|
Reference in New Issue
Block a user