删除无用判断
parent
89ba26c77c
commit
1c9549b105
|
|
@ -372,7 +372,7 @@ public class MqttMessageHandler implements SmartLifecycle {
|
||||||
// 新增:只有在线才转发;不在线就清理残留订阅,解决“取消订阅失败兜底”
|
// 新增:只有在线才转发;不在线就清理残留订阅,解决“取消订阅失败兜底”
|
||||||
String onlineKey = "online:" + clientId;
|
String onlineKey = "online:" + clientId;
|
||||||
Boolean online = stringRedisTemplate.hasKey(onlineKey);
|
Boolean online = stringRedisTemplate.hasKey(onlineKey);
|
||||||
if (online == null || !online) {
|
if (!online) {
|
||||||
// 不在线:从两边索引移除(避免一直给离线前端发)
|
// 不在线:从两边索引移除(避免一直给离线前端发)
|
||||||
stringRedisTemplate.opsForSet().remove("sub:" + deviceId, clientId);
|
stringRedisTemplate.opsForSet().remove("sub:" + deviceId, clientId);
|
||||||
stringRedisTemplate.opsForSet().remove("subc:" + clientId, deviceId);
|
stringRedisTemplate.opsForSet().remove("subc:" + clientId, deviceId);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue