设置过期时间

This commit is contained in:
2024-05-04 10:08:02 +08:00
parent c89b1afdd7
commit b9636a9aad

View File

@@ -570,6 +570,10 @@ 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);
}
// 把充电桩正在充电中的状态存到redis
String pileIsChargingKey = CacheConstants.PILE_IS_CHARGING + realTimeMonitorData.getPileConnectorCode();