|
@@ -39,7 +39,7 @@ public class MyCache {
|
|
|
@PostConstruct
|
|
|
public void init() {
|
|
|
caffeineCache = Caffeine.newBuilder()
|
|
|
- .expireAfterWrite(30, TimeUnit.MINUTES) // 设置缓存过期时间
|
|
|
+ .expireAfterWrite(30, TimeUnit.DAYS) // 设置缓存过期时间
|
|
|
.maximumSize(1000) // 设置缓存最大容量
|
|
|
.recordStats() // 启用缓存统计
|
|
|
.build();
|
|
@@ -77,7 +77,7 @@ public class MyCache {
|
|
|
LocalDateTime createTimePlus30 = cache.getCreateTime().toInstant()
|
|
|
.atZone(java.time.ZoneId.systemDefault())
|
|
|
.toLocalDateTime()
|
|
|
- .plusMinutes(cache.getExpirationDate());
|
|
|
+ .plusDays(cache.getExpirationDate());
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
if (createTimePlus30.isBefore(now)){
|
|
|
platCacheMapper.deleteCache(key);
|
|
@@ -121,7 +121,7 @@ public class MyCache {
|
|
|
LocalDateTime createTimePlus30 = cache.getCreateTime().toInstant()
|
|
|
.atZone(java.time.ZoneId.systemDefault())
|
|
|
.toLocalDateTime()
|
|
|
- .plusMinutes(cache.getExpirationDate());
|
|
|
+ .plusDays(cache.getExpirationDate());
|
|
|
LocalDateTime now = LocalDateTime.now();
|
|
|
if (createTimePlus30.isBefore(now)){
|
|
|
platCacheMapper.deleteCache(key.toString());
|