Commit 45f352b3 by huangjy

fix: 数据保存

parent 0535483c
......@@ -126,7 +126,7 @@ public class PushCallback implements MqttCallback {
Long size = redisTemplate.opsForHash().size(DEVICE_BR_ANALYSIS + device.getDeviceId());
redisTemplate.opsForHash().put(DEVICE_BR_ANALYSIS + device.getDeviceId(), currentSecond,JSON.toJSONString(device.getProperties()));
redisTemplate.expire(DEVICE_BR_ANALYSIS + device.getDeviceId(),duration,TimeUnit.MINUTES);
redisTemplate.expire(DEVICE_BR_ANALYSIS + device.getDeviceId(),duration + 3,TimeUnit.MINUTES);
if (size > duration * 60) {
redisTemplate.opsForHash().delete(DEVICE_BR_ANALYSIS + device.getDeviceId(),currentSecond - duration * 60);
}
......
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