Bugfix: Fix health and ready endpoint checker configurations

This commit is contained in:
Florian Schade
2024-10-17 13:43:42 +02:00
parent 08b33627b2
commit 0437722353
36 changed files with 121 additions and 357 deletions
+4 -13
View File
@@ -13,17 +13,9 @@ import (
func Server(opts ...Option) (*http.Server, error) {
options := newOptions(opts...)
checkHandler := handlers.NewCheckHandler(
handlers.NewCheckHandlerConfiguration().
WithLogger(options.Logger),
)
readyHandler := handlers.NewCheckHandler(
handlers.NewCheckHandlerConfiguration().
WithLogger(options.Logger).
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Cluster)).
WithChecks(checkHandler.Checks()),
)
readyHandlerConfiguration := handlers.NewCheckHandlerConfiguration().
WithLogger(options.Logger).
WithCheck("nats reachability", checks.NewNatsCheck(options.Config.Events.Cluster))
return debug.NewService(
debug.Logger(options.Logger),
@@ -33,7 +25,6 @@ func Server(opts ...Option) (*http.Server, error) {
debug.Token(options.Config.Debug.Token),
debug.Pprof(options.Config.Debug.Pprof),
debug.Zpages(options.Config.Debug.Zpages),
debug.Health(checkHandler),
debug.Ready(readyHandler),
debug.Ready(handlers.NewCheckHandler(readyHandlerConfiguration)),
), nil
}