mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-09-23 01:03:32 +08:00
added healthz endpoint to filer (#4899)
This commit is contained in:
@@ -157,6 +157,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
|
|||||||
|
|
||||||
handleStaticResources(defaultMux)
|
handleStaticResources(defaultMux)
|
||||||
if !option.DisableHttp {
|
if !option.DisableHttp {
|
||||||
|
defaultMux.HandleFunc("/healthz", fs.filerHealthzHandler)
|
||||||
defaultMux.HandleFunc("/", fs.filerHandler)
|
defaultMux.HandleFunc("/", fs.filerHandler)
|
||||||
}
|
}
|
||||||
if defaultMux != readonlyMux {
|
if defaultMux != readonlyMux {
|
||||||
|
@@ -179,3 +179,8 @@ func (fs *FilerServer) maybeCheckJwtAuthorization(r *http.Request, isWrite bool)
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (fs *FilerServer) filerHealthzHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Server", "SeaweedFS Filer "+util.VERSION)
|
||||||
|
w.WriteHeader(http.StatusOK)
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user