You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2022/02/04 14:54:18 UTC

[syncope] 03/03: [SYNCOPE-1612] fix connector/resource connection check (#308)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit c23c02bf222bf7192e6ac82a49fee4b313b92a14
Author: Fabio Martelli <fa...@tirasa.net>
AuthorDate: Fri Feb 4 15:47:57 2022 +0100

    [SYNCOPE-1612] fix connector/resource connection check (#308)
---
 .../client/console/topology/TopologyWebSocketBehavior.java     | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
index f70d6dd..af58261 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/topology/TopologyWebSocketBehavior.java
@@ -61,12 +61,12 @@ public class TopologyWebSocketBehavior extends WebSocketBehavior {
             final Map<String, String> responses,
             final Set<String> running) {
 
-        String response;
+        String response = null;
         try {
-            if (timeout == null || timeout <= 0) {
+            if (timeout == null || timeout < 0) {
                 LOG.debug("No timeouts for resource connection checking ... ");
                 response = checker.call();
-            } else {
+            } else if (timeout > 0) {
                 LOG.debug("Timeouts provided for resource connection checking ... ");
                 response = SyncopeConsoleSession.get().execute(checker).get(timeout, TimeUnit.SECONDS);
             }
@@ -80,7 +80,9 @@ public class TopologyWebSocketBehavior extends WebSocketBehavior {
                     TopologyNode.Status.FAILURE, checker.key);
         }
 
-        responses.put(checker.key, response);
+        if (response != null) {
+            responses.put(checker.key, response);
+        }
 
         running.remove(checker.key);
     }