删除无用判断

feasure
xce 2026-01-18 19:01:34 +08:00
parent 89ba26c77c
commit 1c9549b105
1 changed files with 1 additions and 1 deletions

View File

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