From 9e3d108a0e76ba4f958b1db84f2fbf31476ed019 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 25 Jan 2023 17:49:28 +0100 Subject: [PATCH] WIP:refactor --- .../java/de/juplo/kafka/chat/backend/domain/ChatRoom.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java index a42434b8..9ae967bd 100644 --- a/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java +++ b/src/main/java/de/juplo/kafka/chat/backend/domain/ChatRoom.java @@ -69,9 +69,7 @@ public class ChatRoom .getMessage(key) .flatMap(existing -> text.equals(existing.getMessageText()) ? Mono.just(existing) - : Mono.error(() -> new MessageMutationException(existing, text))) - .onErrorReturn( - service + : service .persistMessage(key, LocalDateTime.now(clock), text) .doOnNext(m -> { @@ -80,7 +78,7 @@ public class ChatRoom { log.warn("Emitting of message failed with {} for {}", result.name(), m); } - }).block()); + })); } -- 2.20.1