Commit 20a31705 authored by martin hou's avatar martin hou

fix: 降低onprogress的回调频率以及修改日志内容

parent 82d1867b
...@@ -1015,9 +1015,9 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -1015,9 +1015,9 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
{ {
let percent = Math.floor(recvBytes / length * 100); let percent = Math.floor(recvBytes / length * 100);
let k = 't' + percent; let k = 't' + percent;
if (percent % 5 == 0 && percent > 0 && percent < 100) if (percent % 5 == 0 && percent > 0 && percent < 100 && !(k in this._progress_report))
{ {
Logger.info('jensen', 'file-transfer', new Date().getTime()); Logger.info('jensen', 'file-transfer', percent);
this._progress_report[k] && onprogress?.(recvBytes); this._progress_report[k] && onprogress?.(recvBytes);
this._progress_report[k] = true; this._progress_report[k] = true;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment