|
@@ -33,6 +33,7 @@ import java.util.*;
|
|
|
import java.util.concurrent.ConcurrentHashMap;
|
|
|
import java.util.concurrent.CountDownLatch;
|
|
|
import java.util.concurrent.Executor;
|
|
|
+import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
@Slf4j
|
|
|
@Service
|
|
@@ -62,7 +63,7 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
// 单次同步邮件总次数
|
|
|
private static int mailCount;
|
|
|
// 最小等待时间
|
|
|
- private static final long minWaitingTime = 1000 * 30;
|
|
|
+ private static final long minWaitingTime = 1000 * 45;
|
|
|
// 初始化同步邮件天数
|
|
|
private static final int initDay = 7;
|
|
|
// 缓存错误次数
|
|
@@ -125,7 +126,10 @@ public class CoreServiceImpl implements ApplicationRunner {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- countDownLatch.await();
|
|
|
+ boolean b = countDownLatch.await(5, TimeUnit.MINUTES);
|
|
|
+ if (!b) {
|
|
|
+ log.error("超时执行");
|
|
|
+ }
|
|
|
} catch (InterruptedException e) {
|
|
|
log.error("countDownLatch.await() 发生异常", e);
|
|
|
}
|