|
@@ -32,14 +32,14 @@ public class CheckTimeServiceImpl implements CheckTimeService {
|
32
|
32
|
String redisKey = REDIS_KEY_PREFIX + key;
|
33
|
33
|
|
34
|
34
|
Object value = redisTemplate.opsForValue().get(redisKey);
|
35
|
|
-
|
36
|
|
- if (value != null) {
|
37
|
|
- LocalDateTime.ofInstant(new Date(Long.parseLong(value.toString())).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
|
|
35
|
+ long last;
|
|
36
|
+ //noinspection ConstantConditions
|
|
37
|
+ if (value == null) {
|
|
38
|
+ last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
|
|
39
|
+ } else {
|
|
40
|
+ last = Long.parseLong(value.toString());
|
38
|
41
|
}
|
39
|
|
-
|
40
|
|
- long last = System.currentTimeMillis() - ElasticConstant.CHECK_TIME_INTERVAL;
|
41
|
42
|
redisTemplate.opsForValue().set(redisKey, last);
|
42
|
|
-
|
43
|
43
|
return LocalDateTime.ofInstant(new Date(last).toInstant(), ZoneId.systemDefault()).format(DateUtil.DATE_TIME_FORMATTER);
|
44
|
44
|
}
|
45
|
45
|
|