Arsnael commented on code in PR #2837:
URL: https://github.com/apache/james-project/pull/2837#discussion_r2453791183
##########
mailbox/postgres/src/main/java/org/apache/james/mailbox/postgres/DeleteMessageListener.java:
##########
@@ -140,7 +144,9 @@ private Mono<Void> handleMessageDeletion(PostgresMessageDAO
postgresMessageDAO,
.flatMap(msgId -> postgresMessageDAO.retrieveMessage(messageId)
.flatMap(executeDeletionCallbacks(mailboxId, owner))
.then(deleteBodyBlob(msgId, postgresMessageDAO))
- .then(deleteAttachment(msgId, attachmentDAO))
+ .then(postgresConfiguration.isAttachmentStorageEnabled()
+ ? deleteAttachment(msgId, attachmentDAO)
+ : Mono.empty())
Review Comment:
The conditional operator ain't really much used in James codebase. We
usually prefer extracting this into a private method and using an explicit if
condition.
--
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]