Commit 0af1887e by huangjy

fix:设备上报缓存过期时间5秒

parent 15850ec9
......@@ -103,15 +103,15 @@ public class PushCallback implements MqttCallback {
// TODO 先这样判断
if (headers.getProductName().contains("呼吸")) {
redisTemplate.opsForValue().set(DEVICE_BR_DATA + device.getDeviceId(),JSON.toJSONString(device.getProperties()),
1000, TimeUnit.MILLISECONDS);
5000, TimeUnit.MILLISECONDS);
}
if (headers.getProductName().contains("空间")) {
redisTemplate.opsForValue().set(DEVICE_SPACE_DATA + device.getDeviceId(),JSON.toJSONString(device.getProperties()),
1000, TimeUnit.MILLISECONDS);
5000, TimeUnit.MILLISECONDS);
}
if (headers.getProductName().contains("跌倒")) {
redisTemplate.opsForValue().set(DEVICE_FALL_DATA + device.getDeviceId(),JSON.toJSONString(device.getProperties()),
1000, TimeUnit.MILLISECONDS);
5000, TimeUnit.MILLISECONDS);
}
String deviceId = device.getDeviceId();
String messageType = device.getMessageType();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment