From 5cdb82c6a81d6e290fa14d5c01da71ab42c63dae Mon Sep 17 00:00:00 2001 From: Vadim Tkachenko Date: Fri, 6 Oct 2023 22:58:47 -0700 Subject: [PATCH] Bugfix for race condition from rev. 066185a (how permanent?) (#47, #271) --- .../config/connector/ConnectorConfigurationParser.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dz3r-bootstrap/src/main/java/net/sf/dz3r/runtime/config/connector/ConnectorConfigurationParser.java b/dz3r-bootstrap/src/main/java/net/sf/dz3r/runtime/config/connector/ConnectorConfigurationParser.java index 997a41741..22915c08c 100644 --- a/dz3r-bootstrap/src/main/java/net/sf/dz3r/runtime/config/connector/ConnectorConfigurationParser.java +++ b/dz3r-bootstrap/src/main/java/net/sf/dz3r/runtime/config/connector/ConnectorConfigurationParser.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URL; +import java.time.Duration; import java.util.Map; import java.util.Optional; import java.util.Set; @@ -63,7 +64,8 @@ public Flux parse(Set source) { // Prevent multiple subscriptions .publish() - .autoConnect(); + .autoConnect() + .cache(Duration.ofSeconds(30)); // Start right away flux.subscribe(e -> logger.debug("subscription: {}", e));