fix: 解决获取邮件主题时 如果出错导致邮件被删除问题
This commit is contained in:
parent
f2b3f058e6
commit
c1600075fb
|
@ -138,19 +138,9 @@ public class SpectrumParsingActuator implements Runnable{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} 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){
|
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);
|
emailServiceManager.removeMail(message,batchesCounter);
|
||||||
}
|
}
|
||||||
//输出异常信息
|
//输出异常信息
|
||||||
|
|
Loading…
Reference in New Issue
Block a user