This commit is contained in:
satori 2021-12-15 00:40:42 +08:00
parent 4cef0b6b66
commit 8afd1acd15

View File

@ -40,7 +40,10 @@ export default class {
channel.forEach((value, userid) => { channel.forEach((value, userid) => {
console.log(userid, value) console.log(userid, value)
let user = this.users.get(userid) || new Map() let user = this.users.get(userid) || new Map()
if (!user.size) return console.log("订阅频道的用户不在线, 应移除此订阅"); if (!user.size) {
console.log(user)
return console.log(`订阅频道的用户 ${userid} 没有会话连接, 应移除此订阅记录`);
}
user.forEach((value, ws) => { user.forEach((value, ws) => {
ws.send(msg) ws.send(msg)
}) })