|
@@ -162,7 +162,8 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
// 处理时间
|
|
|
long handleTime = end - start;
|
|
|
|
|
|
- log.info("第 {} 伦邮件同步完成,共同步 {} 个邮箱,{} 封邮件,总耗时 {}", num, mailboxSize, mailCount, DateUtil.formatBetween(handleTime));
|
|
|
+ log.info("第 {} 伦邮件同步完成,共同步 {} 个邮箱,{} 封邮件,总耗时 {}",
|
|
|
+ num, mailboxSize, mailCount, DateUtil.formatBetween(handleTime));
|
|
|
|
|
|
// 处理时间是否小于最小处理时间
|
|
|
if (MailSyncInfo.minWaitingTime > handleTime) {
|
|
@@ -329,8 +330,9 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
// 收件时间在上次收件时间之前,不继续找之前的邮件了
|
|
|
- if (receivedDate.before(lastReceivedDate) || receivedDate.equals(lastReceivedDate)) {
|
|
|
+ if (receivedDate.before(lastReceivedDate)) {
|
|
|
break;
|
|
|
}
|
|
|
|
|
@@ -380,7 +382,10 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
|
|
|
// 邮箱是否同步
|
|
|
if (mailboxInfo.getSkip()) {
|
|
|
- personalMailboxService.update(q -> q.eq(BaseEntity::getId, mailboxInfo.getId()).set(PersonalMailbox::getSyncStatus, mailboxInfo.getSkip() ? 0 : 1).set(BaseEntity::getUpdateTime, new Date()));
|
|
|
+ personalMailboxService.update(q -> q
|
|
|
+ .eq(BaseEntity::getId, mailboxInfo.getId())
|
|
|
+ .set(PersonalMailbox::getSyncStatus, mailboxInfo.getSkip() ? 0 : 1)
|
|
|
+ .set(BaseEntity::getUpdateTime, new Date()));
|
|
|
}
|
|
|
|
|
|
PersonalFolder personalFolder = new PersonalFolder();
|
|
@@ -418,7 +423,10 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
|
|
|
// 邮箱是否同步
|
|
|
if (mailboxInfo.getSkip()) {
|
|
|
- enterpriseMailboxService.update(q -> q.eq(BaseEntity::getId, mailboxInfo.getId()).set(EnterpriseMailbox::getSyncStatus, mailboxInfo.getSkip() ? 0 : 1).set(BaseEntity::getUpdateTime, new Date()));
|
|
|
+ enterpriseMailboxService.update(q -> q.
|
|
|
+ eq(BaseEntity::getId, mailboxInfo.getId())
|
|
|
+ .set(EnterpriseMailbox::getSyncStatus, mailboxInfo.getSkip() ? 0 : 1)
|
|
|
+ .set(BaseEntity::getUpdateTime, new Date()));
|
|
|
}
|
|
|
|
|
|
EnterpriseFolder enterpriseFolder = new EnterpriseFolder();
|