Kaynağa Gözat

fix 连接数据库失败时,拉取时间也会增加问题

kerry 5 yıl önce
ebeveyn
işleme
b18e5c92d8

+ 1 - 2
elastic-publish-service/src/main/java/com/vcarecity/publish/service/impl/CheckTimeServiceImpl.java Dosyayı Görüntüle

34
 
34
 
35
         Object value = redisTemplate.opsForValue().get(redisKey);
35
         Object value = redisTemplate.opsForValue().get(redisKey);
36
         long last;
36
         long last;
37
-        //noinspection ConstantConditions
38
         if (value == null) {
37
         if (value == null) {
39
             last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
38
             last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
40
         } else {
39
         } else {
41
             last = Long.parseLong(value.toString());
40
             last = Long.parseLong(value.toString());
42
         }
41
         }
43
-        redisTemplate.opsForValue().set(redisKey, last);
42
+        // redisTemplate.opsForValue().set(redisKey, last);
44
         return LocalDateTime.ofInstant(new Date(last).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
43
         return LocalDateTime.ofInstant(new Date(last).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
45
     }
44
     }
46
 
45
 

+ 0 - 1
elastic-publish-service/src/main/java/com/vcarecity/publish/task/CheckUpdateTask.java Dosyayı Görüntüle

71
 
71
 
72
         if (updateUnit) {
72
         if (updateUnit) {
73
 
73
 
74
-
75
             // 获取上一次的时间
74
             // 获取上一次的时间
76
             fromDateTime = checkTimeService.getLastDateTime("T_UNIT");
75
             fromDateTime = checkTimeService.getLastDateTime("T_UNIT");
77
 
76