Commit 33ddf707b56c305d131e59a2c8a1833ac7ba627d
1 parent
726963ba
界面删除设备后同时删除Redis的对应条目,避免其它设备用同样IP登录时出现信息错误
Showing
1 changed file
with
9 additions
and
0 deletions
src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
| ... | ... | @@ -318,6 +318,15 @@ public class RedisCatchStorageImpl implements IRedisCatchStorage { |
| 318 | 318 | redis.del(key.toString()); |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | + | |
| 322 | + List<Object> deviceCache = redis.scan(String.format("%S%s_%s", VideoManagerConstants.DEVICE_PREFIX, | |
| 323 | + userSetup.getServerId(), | |
| 324 | + deviceId)); | |
| 325 | + if (deviceCache.size() > 0) { | |
| 326 | + for (Object key : deviceCache) { | |
| 327 | + redis.del(key.toString()); | |
| 328 | + } | |
| 329 | + } | |
| 321 | 330 | } |
| 322 | 331 | |
| 323 | 332 | @Override | ... | ... |