mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
Add back existing HealthzOptions.JSEnabled field
This fixes a backwards incompat change for library usage as well as using the healthz NATS API which depends on the JSON payload. Signed-off-by: Byron Ruth <byron@nats.io>
This commit is contained in:
@@ -2631,6 +2631,8 @@ type JSzOptions struct {
|
||||
|
||||
// HealthzOptions are options passed to Healthz
|
||||
type HealthzOptions struct {
|
||||
// Deprecated: Use JSEnabledOnly instead
|
||||
JSEnabled bool `json:"js-enabled,omitempty"`
|
||||
JSEnabledOnly bool `json:"js-enabled-only,omitempty"`
|
||||
JSServerOnly bool `json:"js-server-only,omitempty"`
|
||||
}
|
||||
@@ -2985,7 +2987,8 @@ func (s *Server) HandleHealthz(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
hs := s.healthz(&HealthzOptions{
|
||||
JSEnabledOnly: jsEnabledOnly || jsEnabled,
|
||||
JSEnabled: jsEnabled,
|
||||
JSEnabledOnly: jsEnabledOnly,
|
||||
JSServerOnly: jsServerOnly,
|
||||
})
|
||||
if hs.Error != _EMPTY_ {
|
||||
@@ -3031,7 +3034,7 @@ func (s *Server) healthz(opts *HealthzOptions) *HealthStatus {
|
||||
return health
|
||||
}
|
||||
// Only check if JS is enabled, skip meta and asset check.
|
||||
if opts.JSEnabledOnly {
|
||||
if opts.JSEnabledOnly || opts.JSEnabled {
|
||||
return health
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user