You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "vttranlina (via GitHub)" <gi...@apache.org> on 2023/03/13 02:25:18 UTC

[GitHub] [james-project] vttranlina commented on pull request #1477: JAMES-3440 Fixbug: Data race issue with JMAP email query view

vttranlina commented on PR #1477:
URL: https://github.com/apache/james-project/pull/1477#issuecomment-1465414287

   > Please do a similar for OpenSearch search index too!
   
   The OpenSearch index did that. 
   
   Quote `ListeningMessageSearchIndex.java`
   ```java
       private Mono<Void> handleAdded(MailboxSession session, Mailbox mailbox, Added added) {
           return Flux.fromIterable(MessageRange.toRanges(added.getUids()))
               .concatMap(range -> retrieveMailboxMessages(session, mailbox, range))
               .publishOn(Schedulers.parallel())
               .concatMap(mailboxMessage -> add(session, mailbox, mailboxMessage))
               .then();
       }
   
       private Flux<MailboxMessage> retrieveMailboxMessages(MailboxSession session, Mailbox mailbox, MessageRange range) {
           return factory.getMessageMapper(session)
               .findInMailboxReactive(mailbox, range, FetchType.FULL, UNLIMITED);
       }
   ```
   The `MailboxSessionMapperFactory factory` query db for latest MailboxMessage


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org