Commit b500ae5d authored by martin hou's avatar martin hou

fix: 增加日志

parent 61a80eef
...@@ -1020,7 +1020,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -1020,7 +1020,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
this.onprogress = onprogress; this.onprogress = onprogress;
this.onreceive = function(recvBytes) this.onreceive = function(recvBytes)
{ {
let percent = Math.ceil(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)
{ {
...@@ -1034,6 +1034,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress) ...@@ -1034,6 +1034,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
} }
if (recvBytes == length) if (recvBytes == length)
{ {
Logger.debug('jensen', 'file-transfer', 'current: 100%, ' + recvBytes);
onprogress?.(recvBytes); onprogress?.(recvBytes);
} }
} }
......
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