This is an automated email from the ASF dual-hosted git repository. rcordier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit de174e7e1172494c735451c76e2c465166423326 Author: Benoit Tellier <btell...@linagora.com> AuthorDate: Tue Aug 25 16:57:06 2020 +0700 JAMES-3364 DeletedMessageVaultHook: limit Flux flatMap concurrency Rely on an hard-coded 8 value (constant). --- .../main/java/org/apache/james/vault/DeletedMessageVaultHook.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVaultHook.java b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVaultHook.java index d357649..5474f86 100644 --- a/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVaultHook.java +++ b/mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/DeletedMessageVaultHook.java @@ -90,6 +90,8 @@ public class DeletedMessageVaultHook implements PreDeletionHook { } } + private static final int CONCURRENCY = 8; + private final MailboxSession session; private final DeletedMessageVault deletedMessageVault; private final DeletedMessageConverter deletedMessageConverter; @@ -114,7 +116,7 @@ public class DeletedMessageVaultHook implements PreDeletionHook { Preconditions.checkNotNull(deleteOperation); return groupMetadataByOwnerAndMessageId(deleteOperation) - .flatMap(this::appendToTheVault) + .flatMap(this::appendToTheVault, CONCURRENCY) .then(); } @@ -133,7 +135,7 @@ public class DeletedMessageVaultHook implements PreDeletionHook { private Flux<DeletedMessageMailboxContext> groupMetadataByOwnerAndMessageId(DeleteOperation deleteOperation) { return Flux.fromIterable(deleteOperation.getDeletionMetadataList()) .groupBy(MetadataWithMailboxId::getMailboxId) - .flatMap(this::addOwnerToMetadata); + .flatMap(this::addOwnerToMetadata, CONCURRENCY); } private Flux<DeletedMessageMailboxContext> addOwnerToMetadata(GroupedFlux<MailboxId, MetadataWithMailboxId> groupedFlux) { --------------------------------------------------------------------- To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org For additional commands, e-mail: server-dev-h...@james.apache.org