Commit a25d4fb2 authored by martin hou's avatar martin hou

fix: 变量错误

parent 57c5bcc1
...@@ -293,7 +293,7 @@ function Jensen(log, conn) { ...@@ -293,7 +293,7 @@ function Jensen(log, conn) {
Logger.debug('jensen', 'sendNext', pid + '-command: ' + cmd.command + ', data bytes: ' + data.byteLength); Logger.debug('jensen', 'sendNext', pid + '-command: ' + cmd.command + ', data bytes: ' + data.byteLength);
self.timewait = cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK ? 1000 : 10; self.timewait = cmd.command == TRANSFER_FILE || cmd.command == GET_FILE_BLOCK ? 1000 : 10;
console.log(pid + 'Send', data); console.log(pid + '-send', data);
await device.transferOut(1, data).catch((e) => crash('sendNext', e)); await device.transferOut(1, data).catch((e) => crash('sendNext', e));
if (cmd.onprogress) cmd.onprogress(1, 1); if (cmd.onprogress) cmd.onprogress(1, 1);
/* /*
...@@ -381,7 +381,7 @@ function Jensen(log, conn) { ...@@ -381,7 +381,7 @@ function Jensen(log, conn) {
// console.log('trace', device); // console.log('trace', device);
device.transferIn(2, RECV_BUFF_SIZE).then((r) => { device.transferIn(2, RECV_BUFF_SIZE).then((r) => {
Logger.save?.('jensen', 'tryReceive', r?.data); Logger.save?.('jensen', 'tryReceive', r?.data);
console.log(pid + ' Receive', r?.data); console.log(pid + '-Receive', new Date().toLocaleString(), r?.data);
receive(r); receive(r);
}).catch((e) => { }).catch((e) => {
console.log('tryReceive error', e) console.log('tryReceive error', e)
...@@ -859,20 +859,18 @@ Jensen.prototype.listFiles = async function () { ...@@ -859,20 +859,18 @@ Jensen.prototype.listFiles = async function () {
jensen[kv] = now; jensen[kv] = now;
let ts = 2500; let ts = 2500;
// 如果差的数量还比较多,那就多等一会儿
if (fc == files.length) if (fc == files.length)
{ {
return files.filter((f) => { return Boolean(f.time); }); return files.filter((f) => { return Boolean(f.time); });
} }
else if (fc - files.length < 10) fc = 1000; else if (fc - files.length < 10) ts = 1000;
else fc = 35000; else ts = 15000;
jensen[kv] = window.setTimeout(() => { jensen[kv] = window.setTimeout(() => {
console.log('remove tag: ' + tag); console.log('remove tag: ' + tag);
jensen[tag] = null; jensen[tag] = null;
jensen._trigger(files.filter((f) => { return Boolean(f.time); }), QUERY_FILE_LIST); jensen._trigger(files.filter((f) => { return Boolean(f.time); }), QUERY_FILE_LIST);
console.log('jensen', 'list-files', 'timed return'); console.log('jensen', 'list-files', 'timed return');
}, ts); }, ts);
}); });
return this.send(new Command(QUERY_FILE_LIST)); return this.send(new Command(QUERY_FILE_LIST));
......
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