Browse Source

added healthz endpoint to filer (#4899)

pull/4902/head
Yuval Yacoby 1 year ago
committed by GitHub
parent
commit
3fe00996b2
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      weed/server/filer_server.go
  2. 5
      weed/server/filer_server_handlers.go

1
weed/server/filer_server.go

@ -157,6 +157,7 @@ func NewFilerServer(defaultMux, readonlyMux *http.ServeMux, option *FilerOption)
handleStaticResources(defaultMux)
if !option.DisableHttp {
defaultMux.HandleFunc("/healthz", fs.filerHealthzHandler)
defaultMux.HandleFunc("/", fs.filerHandler)
}
if defaultMux != readonlyMux {

5
weed/server/filer_server_handlers.go

@ -179,3 +179,8 @@ func (fs *FilerServer) maybeCheckJwtAuthorization(r *http.Request, isWrite bool)
return true
}
}
func (fs *FilerServer) filerHealthzHandler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "SeaweedFS Filer "+util.VERSION)
w.WriteHeader(http.StatusOK)
}
Loading…
Cancel
Save