From dec0b5d26903c5a5cce10c4188fdd85513e69831 Mon Sep 17 00:00:00 2001 From: Aroooba Date: Sun, 23 Jul 2023 17:10:45 +0900 Subject: [PATCH] Move blocking readPair call to boundedElastic thread --- .../cassandra/mail/CassandraMessageMapper.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java index 04ed2cab132..d594347111a 100644 --- a/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java +++ b/mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java @@ -170,7 +170,16 @@ public Mono getMailboxCountersReactive(Mailbox mailbox) { } return Mono.just(counters); }) - .doOnNext(counters -> readRepair(mailbox, counters)); + .doOnNext(counters -> { + if (this.cassandraConfiguration.getMailboxReadRepair() > 0) { + Mono.fromRunnable(() -> { + readRepair(mailbox, counters); + }) + .subscribeOn(Schedulers.boundedElastic()) + .subscribe(); + } + }); + } public Mono readMailboxCounters(CassandraId mailboxId) {