Commit c3543d65 authored by martin hou's avatar martin hou

fix: debug

parent b4133679
...@@ -446,10 +446,10 @@ function Jensen(log, conn) { ...@@ -446,10 +446,10 @@ function Jensen(log, conn) {
let handler = handlers[msg.id]; let handler = handlers[msg.id];
if (!handler) handler = Jensen.handlers[msg.id]; if (!handler) handler = Jensen.handlers[msg.id];
let r = handler(msg, self); let r = handler(msg, self);
if (r) console.log('x111111111111'), trigger(r, msg.id); if (r) trigger(r, msg.id);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
console.log('x22222222222222'), trigger(e); trigger(e);
Logger.error('jensen', 'receive', pid + '-recv: ' + msg.id + ', seq: ' + msg.sequence + ', error: ' + String(e)); Logger.error('jensen', 'receive', pid + '-recv: ' + msg.id + ', seq: ' + msg.sequence + ', error: ' + String(e));
} }
sendNext(); sendNext();
...@@ -464,12 +464,10 @@ function Jensen(log, conn) { ...@@ -464,12 +464,10 @@ function Jensen(log, conn) {
if (!handler) handler = Jensen.handlers[msgid]; if (!handler) handler = Jensen.handlers[msgid];
handler(null, self); handler(null, self);
} catch (e) { } catch (e) {
console.log('x3333333333333333');
console.error(e); console.error(e);
trigger(e); trigger(e);
Logger.error('jensen', 'decode', 'decode error: ' + String(e)); Logger.error('jensen', 'decode', 'decode error: ' + String(e));
} }
console.log('x44444444444444444444'),
trigger(null, msgid); trigger(null, msgid);
blocks.length = 0; blocks.length = 0;
break; break;
...@@ -682,9 +680,14 @@ Jensen.prototype.listFiles = async function () { ...@@ -682,9 +680,14 @@ Jensen.prototype.listFiles = async function () {
this.registerHandler(QUERY_FILE_LIST, (msg, jensen) => { this.registerHandler(QUERY_FILE_LIST, (msg, jensen) => {
console.log('tag', tag); console.log('tag', tag);
if (msg.body.length == 0) { if (msg.body.length == 0) {
console.log('remove tag: ' + tag);
jensen[tag] = null; jensen[tag] = null;
return []; return [];
} }
if (jensen[tag] == null)
{
console.trace('no tag for: ' + tag);
}
jensen[tag].push(msg.body); jensen[tag].push(msg.body);
let data = []; let data = [];
let files = []; let files = [];
...@@ -792,6 +795,7 @@ Jensen.prototype.listFiles = async function () { ...@@ -792,6 +795,7 @@ Jensen.prototype.listFiles = async function () {
if ((fc && files.length >= fc.count) || (fcount > -1 && files.length >= fcount)) { if ((fc && files.length >= fc.count) || (fcount > -1 && files.length >= fcount)) {
// delete jensen[tag]; // delete jensen[tag];
console.log('remove tag: ' + tag);
jensen[tag] = null; jensen[tag] = null;
window.clearTimeout(jensen[kv]); window.clearTimeout(jensen[kv]);
console.log('jensen', 'list-files', 'normal return'); console.log('jensen', 'list-files', 'normal return');
...@@ -803,6 +807,7 @@ Jensen.prototype.listFiles = async function () { ...@@ -803,6 +807,7 @@ Jensen.prototype.listFiles = async function () {
{ {
// 要怎么样触发这个回调? // 要怎么样触发这个回调?
jensen[kv] = window.setTimeout(() => { jensen[kv] = window.setTimeout(() => {
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');
......
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