mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-03-12 16:58:41 -05:00
add http checks to idp & graph
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -14,7 +14,8 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
|
||||
checkHandler := handlers.NewCheckHandler(
|
||||
handlers.NewCheckHandlerConfiguration().
|
||||
WithLogger(options.Logger),
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("web reachability", handlers.NewHTTPCheck(options.Config.HTTP.Addr)),
|
||||
)
|
||||
|
||||
return debug.NewService(
|
||||
|
||||
@@ -14,7 +14,13 @@ import (
|
||||
func Server(opts ...Option) (*http.Server, error) {
|
||||
options := newOptions(opts...)
|
||||
|
||||
checkHandler := handlers.NewCheckHandler(
|
||||
healthHandler := handlers.NewCheckHandler(
|
||||
handlers.NewCheckHandlerConfiguration().
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("http reachability", handlers.NewHTTPCheck(options.Config.HTTP.Addr)),
|
||||
)
|
||||
|
||||
readinessHandler := handlers.NewCheckHandler(
|
||||
handlers.NewCheckHandlerConfiguration().
|
||||
WithLogger(options.Logger).
|
||||
WithCheck("tcp-check", func(ctx context.Context) error {
|
||||
@@ -28,7 +34,8 @@ func Server(opts ...Option) (*http.Server, error) {
|
||||
}
|
||||
|
||||
return handlers.NewTCPCheck(tcpURL)(ctx)
|
||||
}),
|
||||
}).
|
||||
WithInheritedChecksFrom(healthHandler.Conf),
|
||||
)
|
||||
|
||||
return debug.NewService(
|
||||
@@ -39,7 +46,7 @@ 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(checkHandler),
|
||||
debug.Health(healthHandler),
|
||||
debug.Ready(readinessHandler),
|
||||
), nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user