Commit 82d1867b authored by martin hou's avatar martin hou

fix: 增加回调时间日志和原始列表输出

parent 1d0e8ad4
......@@ -296,6 +296,8 @@ function Jensen(log, conn) {
console.log(pid + '-send', data);
if (self.onprogress && (cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK))
{
self.transferStartTime = new Date().getTime();
Logger.debug('jensen', 'file-transfer', new Date().getTime());
try { self.onprogress(0); } catch(e) { }
}
await device.transferOut(1, data).catch((e) => crash('sendNext', e));
......@@ -819,6 +821,7 @@ Jensen.prototype.listFiles = async function () {
if ((fc && files.length >= fc.count) || (fcount > -1 && files.length >= fcount)) {
// delete jensen[tag];
jensen[tag] = null;
console.log('original file list:', files);
return files.filter((f) => {
return Boolean(f.time);
});
......@@ -1014,6 +1017,7 @@ Jensen.prototype.getFile = async function (filename, length, ondata, onprogress)
let k = 't' + percent;
if (percent % 5 == 0 && percent > 0 && percent < 100)
{
Logger.info('jensen', 'file-transfer', new Date().getTime());
this._progress_report[k] && onprogress?.(recvBytes);
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