From 4128c047201fa5270b948b067bc9f4d3e07ac5f5 Mon Sep 17 00:00:00 2001 From: Koushik R Date: Fri, 10 Nov 2023 22:40:43 +0530 Subject: [PATCH] Bug Fix : When the Collection of Services is empty the monitor should just gracefully return. --- .../io/appform/ranger/core/finderhub/ServiceFinderHub.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ranger-core/src/main/java/io/appform/ranger/core/finderhub/ServiceFinderHub.java b/ranger-core/src/main/java/io/appform/ranger/core/finderhub/ServiceFinderHub.java index e14f7994..4246dd0e 100644 --- a/ranger-core/src/main/java/io/appform/ranger/core/finderhub/ServiceFinderHub.java +++ b/ranger-core/src/main/java/io/appform/ranger/core/finderhub/ServiceFinderHub.java @@ -163,6 +163,10 @@ private void updateRegistry() { final Map> updatedFinders = new HashMap<>(); try { val services = serviceDataSource.services(); + if(services.isEmpty()) { + log.debug("No services found for the service data source. Skipping update on the registry"); + return; + } val knownServiceFinders = finders.get(); val newFinders = services.stream() .filter(service -> !knownServiceFinders.containsKey(service))