fix: 解决获取邮件主题时 如果出错导致邮件被删除问题

This commit is contained in:
orgin 2024-02-29 14:26:21 +08:00
parent f2b3f058e6
commit c1600075fb

View File

@ -138,19 +138,9 @@ public class SpectrumParsingActuator implements Runnable{
}
}
} catch (Exception e) {
try {
if (StrUtil.isBlank(subject)) {
subject = message.getSubject();
}
if (StrUtil.isBlank(receiveDate)) {
receiveDate = DateUtils.formatDate(message.getReceivedDate(),"yyyy-MM-dd HH:mm:ss");
}
} catch (MessagingException ex) {
log.error("SpectrumParsingActuator中获取Message信息出现异常", ex);
}
// 如果不是下载导致的失败 并且 下载成功则删除下载的邮件对象
if(!(e instanceof DownloadEmailException) && downloadFlag){
log.error("Remove Email"+ subject + StringPool.UNDERSCORE + receiveDate + StringPool.UNDERSCORE);
log.error("Catch Remove Email"+ subject + StringPool.UNDERSCORE + receiveDate + StringPool.UNDERSCORE);
emailServiceManager.removeMail(message,batchesCounter);
}
//输出异常信息