[*] 日常优化

This commit is contained in:
acgist
2023-09-22 07:47:56 +08:00
parent 107a9e301d
commit 295693cba5
3 changed files with 29 additions and 24 deletions

View File

@@ -1107,23 +1107,22 @@ class Taoyao {
* @param {*} body 消息主体
*/
async mediaConsumerStatus(message, body) {
const me = this;
const {
roomId,
consumerId,
} = body;
const room = me.rooms.get(roomId);
const room = this.rooms.get(roomId);
const consumer = room?.consumers.get(consumerId);
if(consumer) {
console.debug("查询消费者状态", consumerId);
message.body = {
...body,
status: await consumer.getStats()
};
me.push(message);
} else {
console.debug("查询消费者状态(无效)", consumerId);
if(!consumer) {
console.debug("查询消费者状态(消费者无效)", roomId, consumerId);
return;
}
console.debug("查询消费者状态", consumerId);
message.body = {
...body,
status: await consumer.getStats()
};
this.push(message);
}
/**