chibenwa commented on code in PR #2514:
URL: https://github.com/apache/james-project/pull/2514#discussion_r1860104884


##########
server/blob/blob-postgres/src/test/java/org/apache/james/blob/postgres/PostgresBlobStoreGCAlgorithmTest.java:
##########
@@ -50,6 +49,7 @@ public class PostgresBlobStoreGCAlgorithmTest implements 
BloomFilterGCAlgorithmC
 
     @BeforeEach
     void beforeEach() {
+        System.setProperty("james.postgresql.query.batch.size", "10");

Review Comment:
   Do not forget to unset it at the end of the test



##########
mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/mail/dao/PostgresMailboxMessageDAO.java:
##########
@@ -271,51 +271,62 @@ public Mono<Pair<Integer, Integer>> 
countTotalAndUnseenMessagesByMailboxId(Postg
 
     public Flux<Pair<SimpleMailboxMessage.Builder, Record>> 
findMessagesByMailboxId(PostgresMailboxId mailboxId, Limit limit, 
MessageMapper.FetchType fetchType) {
         if (limit.isUnlimited()) {
-            return Flux.range(0, OFFSET_UNLIMITED)
-                .concatMap(offsetIndex -> 
findMessagesByMailboxIdBatch(mailboxId, fetchType, offsetIndex * 
QUERY_BATCH_SIZE, QUERY_BATCH_SIZE))
-                .takeUntil(List::isEmpty)
+            return Flux.defer(() -> findMessagesByMailboxIdBatch(mailboxId, 
fetchType, Optional.empty(), QUERY_BATCH_SIZE))
+                .expand(messages -> {

Review Comment:
   <3



-- 
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-unsubscr...@james.apache.org

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


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

Reply via email to