fix: 盐度设置,Redis失效问题解决。
This commit is contained in:
@@ -2112,9 +2112,13 @@ public class IotController extends BaseController {
|
||||
log.warn("太阳能网控盐度缓存失败: deviceId={}, serialNum和iotId均为空", device.getId());
|
||||
return false;
|
||||
}
|
||||
for (String key : cacheKeys) {
|
||||
com.intc.common.redis.utils.RedisUtils.setCacheObject(key, cacheJson, Duration.ofDays(7));
|
||||
}
|
||||
// 忽略租户前缀:HTTP线程写入带租户前缀,AMQP消费线程读取不带前缀,需统一
|
||||
final String cacheJsonRef = cacheJson;
|
||||
TenantHelper.ignore(() -> {
|
||||
for (String key : cacheKeys) {
|
||||
com.intc.common.redis.utils.RedisUtils.setCacheObject(key, cacheJsonRef, Duration.ofDays(7));
|
||||
}
|
||||
});
|
||||
log.info("太阳能网控盐度已缓存,等待上线补发: deviceId={}, serialNum={}, iotId={}, cacheKeys={}, salinityCompensation={}",
|
||||
device.getId(), device.getSerialNum(), device.getIotId(), cacheKeys, salinityCompensation);
|
||||
return true;
|
||||
@@ -2137,7 +2141,9 @@ public class IotController extends BaseController {
|
||||
if (serialNum == null || serialNum.isBlank()) {
|
||||
return;
|
||||
}
|
||||
com.intc.common.redis.utils.RedisUtils.deleteObject(DeviceDataHandler.PENDING_SOLAR_SALINITY_KEY_PREFIX + serialNum);
|
||||
TenantHelper.ignore(() ->
|
||||
com.intc.common.redis.utils.RedisUtils.deleteObject(DeviceDataHandler.PENDING_SOLAR_SALINITY_KEY_PREFIX + serialNum)
|
||||
);
|
||||
}
|
||||
|
||||
private java.util.List<String> buildPendingSolarSalinityKeys(Device device) {
|
||||
|
||||
Reference in New Issue
Block a user