diff --git a/dz3r-model/src/main/java/net/sf/dz3r/model/Zone.java b/dz3r-model/src/main/java/net/sf/dz3r/model/Zone.java index 708ae04d3..d19bdd13a 100644 --- a/dz3r-model/src/main/java/net/sf/dz3r/model/Zone.java +++ b/dz3r-model/src/main/java/net/sf/dz3r/model/Zone.java @@ -200,7 +200,9 @@ public Flux> compute(Flux> in) // - the feedback, repeats the last sensor reading upon changing zone settings and forces a new signal to be emitted here // Record the signal so the feedback flux can pick it up - var recorded = in.doOnNext(this::recordSignal); + var recorded = in + .doOnNext(this::recordSignal) + .doOnComplete(feedbackSink::tryEmitComplete); var combined = Flux.merge(recorded, feedbackFlux); @@ -300,8 +302,6 @@ public void close() throws Exception { economizer.close(); } - feedbackSink.tryEmitComplete(); - } finally { logger.info("Shut down: {}", getAddress()); ThreadContext.pop();