From 186c6f5f405077fbc60db3080525bd91e7cec10a Mon Sep 17 00:00:00 2001 From: Guoqs Date: Sat, 4 May 2024 10:11:41 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=BF=87=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/service/impl/PileBasicInfoServiceImpl.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java index c71d391ef..1b03c48e5 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileBasicInfoServiceImpl.java @@ -570,9 +570,14 @@ public class PileBasicInfoServiceImpl implements PileBasicInfoService { String jsonMsg = JSON.toJSONString(realTimeMonitorData); // 上传实时数据每10秒发送一次,1分钟6次,在同一分钟内,只保留最后一条实时数据 redisCache.hset(redisKey, DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:00", now), jsonMsg); - // 设置过期时间 - if (redisCache.getExpire(redisKey) < 0) { - redisCache.expire(redisKey, CacheConstants.cache_expire_time_1d); + + try { + // 设置过期时间 + if (redisCache.getExpire(redisKey) < 0) { + redisCache.expire(redisKey, CacheConstants.cache_expire_time_1d); + } + } catch (Exception e) { + log.info("设置过期时间error", e); } // 把充电桩正在充电中的状态存到redis