From a970284fb7ce73e952bc8a9010c2a2aa80302fb9 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 23 Oct 2024 17:37:54 +0200 Subject: [PATCH] fixed `includeCollections` parameter --- .../geoportal/service/rest/health/MongoHealthCheck.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/health/MongoHealthCheck.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/health/MongoHealthCheck.java index 4cf7b13..be7cf23 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/health/MongoHealthCheck.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/health/MongoHealthCheck.java @@ -28,7 +28,7 @@ import lombok.extern.slf4j.Slf4j; public class MongoHealthCheck implements HealthCheck { private String context; - private Boolean includeCollections; + private Boolean includeCollections = false; public static final String SERVICE_NAME = "mongo"; /** @@ -67,7 +67,7 @@ public class MongoHealthCheck implements HealthCheck { mongo = ImplementationProvider.get().getProvidedObjectByClass(Mongo.class); buildHCRBuilder = appendMongoInfo(buildHCRBuilder, mongo.getConnection()); buildHCRBuilder.state(true); - if (includeCollections) { + if (includeCollections!=null && includeCollections) { MongoIterable collections = mongo.getTheClient() .getDatabase(mongo.getConnection().getDatabase()).listCollectionNames(); log.info("listCollectionNames is null: {}", collections == null);