quantranhong1999 commented on code in PR #2902:
URL: https://github.com/apache/james-project/pull/2902#discussion_r2697682113
##########
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreDeletedMessageVault.java:
##########
@@ -204,4 +250,21 @@ private Mono<Void> deleteBucketData(BucketName bucketName)
{
return Mono.from(blobStore.deleteBucket(bucketName))
.then(Mono.from(messageMetadataVault.removeMetadataRelatedToBucket(bucketName)));
}
+
+ private Mono<Void> deleteUserExpiredMessages(ZonedDateTime
beginningOfRetentionPeriod, BlobStoreVaultGarbageCollectionContext context) {
+ BucketName bucketName =
BucketName.of(vaultConfiguration.getSingleBucketName());
+
+ return Flux.from(usersRepository.listReactive())
+ .flatMap(username ->
Flux.from(messageMetadataVault.listMessages(bucketName, username))
+ .filter(deletedMessage ->
isMessageFullyExpired(beginningOfRetentionPeriod, deletedMessage))
+ .flatMap(deletedMessage ->
Mono.from(messageMetadataVault.remove(bucketName, username,
deletedMessage.getDeletedMessage().getMessageId()))
Review Comment:
```suggestion
.flatMap(deletedMessage ->
Mono.from(blobStoreDAO.delete(deletedMessage.getStorageInformation().getBucketName(),
deletedMessage.getStorageInformation().getBlobId()))
.then(Mono.from(messageMetadataVault.remove(DEFAULT_SINGLE_BUCKET_NAME,
username, deletedMessage.getDeletedMessage().getMessageId())))
```
To delete the actual blob too?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]