修正清理roomcount信息时, 有时报对象为空的bug
This commit is contained in:
parent
925976cbae
commit
a0c57268d2
@ -141,11 +141,12 @@ export class Service {
|
||||
const nodes = nodeStrs.map(data => parseNode(data))
|
||||
const nodeMap = nodes.toMap('processId')
|
||||
const countObjs = await client.hgetall(ROOM_COUNT_KEY)
|
||||
for (let key of Object.keys(countObjs)) {
|
||||
if (!nodeMap.has(key)) {
|
||||
await client.hdel(ROOM_COUNT_KEY, key)
|
||||
if (countObjs) {
|
||||
for (let key of Object.keys(countObjs)) {
|
||||
if (!nodeMap.has(key)) {
|
||||
await client.hdel(ROOM_COUNT_KEY, key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user