only check nats if it is used

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2024-11-07 12:26:12 +01:00
parent a46ea13e41
commit 409259949e
3 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -17,7 +17,7 @@ func Server(opts ...Option) (*http.Server, error) {
readyHandlerConfiguration := handlers.NewCheckHandlerConfiguration().
WithLogger(options.Logger).
WithCheck("nats reachability", func(ctx context.Context) error {
if len(options.Config.Cache.ProviderCacheNodes) > 0 {
if options.Config.Cache.ProviderCacheStore == "nats-js-kv" && len(options.Config.Cache.ProviderCacheNodes) > 0 {
return checks.NewNatsCheck(options.Config.Cache.ProviderCacheNodes[0])(ctx)
}
return nil