refactor: send rate

This commit is contained in:
手瓜一十雪 2024-05-30 22:38:02 +08:00
parent 70124d5177
commit 1e0820d613
2 changed files with 5 additions and 2 deletions

View File

@ -118,7 +118,10 @@ const _handlers: {
[OB11MessageDataType.file]: async (sendMsg, context) => {
const { path, fileName } = await handleOb11FileLikeMessage(sendMsg, context);
//logDebug('发送文件', path, fileName);
return SendMsgElementConstructor.file(path, fileName);
const FileEle = await SendMsgElementConstructor.file(path, fileName);
// 清除Upload的应该
// context.deleteAfterSentFiles.push(fileName || FileEle.fileElement.filePath);
return FileEle;
},
[OB11MessageDataType.video]: async (sendMsg, context) => {

View File

@ -55,7 +55,7 @@ export async function sendMsg(peer: Peer, sendElements: SendMessageElement[], de
}
}
//且 PredictTime ((totalSize / 1024 / 512) * 1000)不等于Nan
const PredictTime = totalSize / 1024 / 512 * 1000;
const PredictTime = totalSize / 1024 / 256 * 1000;
if (!Number.isNaN(PredictTime)) {
timeout += PredictTime;// 5S Basic Timeout + PredictTime( For File 512kb/s )
}