You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "quantranhong1999 (via GitHub)" <gi...@apache.org> on 2023/08/29 09:26:47 UTC

[GitHub] [james-project] quantranhong1999 commented on a diff in pull request #1701: JAMES-3925 Rework JMAP quota cleaup

quantranhong1999 commented on code in PR #1701:
URL: https://github.com/apache/james-project/pull/1701#discussion_r1308480883


##########
server/data/data-jmap-cassandra/src/main/java/org/apache/james/jmap/cassandra/upload/CassandraUploadRepository.java:
##########
@@ -90,7 +90,8 @@ public Flux<UploadMetaData> listUploads(Username user) {
 
     public Mono<Void> purge() {
         Instant sevenDaysAgo = clock.instant().minus(EXPIRE_DURATION);
-        return Flux.from(uploadDAO.listByUploadDateLessThan(sevenDaysAgo))
+        return Flux.from(uploadDAO.all())
+            .filter(upload -> upload.getUploadDate().isBefore(sevenDaysAgo))
             .concatMap(upload -> Mono.from(blobStore.delete(UPLOAD_BUCKET, upload.getBlobId()))
                 .then(uploadDAO.delete(upload.getUser(), upload.getId())))

Review Comment:
   Q: Should we use flatMap to fasten the deletion?



-- 
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