From d2c426a035e43c7ce7c6a379ba765a2d62573e2e 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 --- .../mailbox/cassandra/mail/CassandraMessageMapper.java | 9 ++++++++- 1 file changed, 8 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 04ed2cab1329..8b1f2f7f4cc0 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,14 @@ public Mono getMailboxCountersReactive(Mailbox mailbox) { } return Mono.just(counters); }) - .doOnNext(counters -> readRepair(mailbox, counters)); + .doOnNext(counters -> { + Mono.fromRunnable(() -> { + readRepair(mailbox, counters); + }) + .subscribeOn(Schedulers.boundedElastic()) + .subscribe(); + }); + } public Mono readMailboxCounters(CassandraId mailboxId) {