This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 432f2d686d693b6bedb5d891fd0f15cfdcaa020b Author: Benoit Tellier <[email protected]> AuthorDate: Tue Oct 27 12:52:25 2020 +0700 JAMES-3408 Limit concurrency when retrieving mailbox counters 4 in parrallel instead of 128 should limit pressure on the DB --- .../main/java/org/apache/james/mailbox/store/StoreMailboxManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java index 97c1972..6e075c0 100644 --- a/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java +++ b/mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java @@ -650,11 +650,13 @@ public class StoreMailboxManager implements MailboxManager { private Function<Flux<Mailbox>, Flux<MailboxMetaData>> withCounters(MailboxSession session, List<Mailbox> mailboxes) { MessageMapper messageMapper = mailboxSessionMapperFactory.getMessageMapper(session); + int concurrency = 4; return mailboxFlux -> mailboxFlux .flatMap(mailbox -> retrieveCounters(messageMapper, mailbox, session) .map(Throwing.<MailboxCounters, MailboxMetaData>function( counters -> toMailboxMetadata(session, mailboxes, mailbox, counters)) - .sneakyThrow())); + .sneakyThrow()), + concurrency); } private Function<Flux<Mailbox>, Flux<MailboxMetaData>> withoutCounters(MailboxSession session, List<Mailbox> mailboxes) { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
