Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
jianmingtu committed Jun 24, 2024
1 parent 85617e7 commit eb171c6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,12 @@ public void pollForEmails() {
logger.debug("attempting to retrieve email attachments");
List<FileAttachment> fileAttachments = emailService.getFileAttachments(item.getId().getUniqueId());
logger.info("successfully retrieved {} attachments", fileAttachments.size());
logMemory();

Optional<FileAttachment> attachment = fileAttachments.stream().findFirst();

if (!attachment.isPresent()) throw new DpsEmailException("No attachment present in email.");
logMemory();

logger.debug("attempting to store email attachment");
String fileId = this.storageService.put(attachment.get().getContent());
Expand All @@ -103,6 +105,7 @@ public void pollForEmails() {
MDC.put(MdcConstants.MDC_TRANSACTION_ID_KEY, metadata.getTransactionId().toString());

logger.info("successfully parsed email content");
logMemory();

EmailMessage processedItem = emailService.moveToProcessingFolder(item.getId().getUniqueId());
metadata.setEmailId(processedItem.getId().getUniqueId());
Expand Down

0 comments on commit eb171c6

Please sign in to comment.