Commit 94668f58 authored by martin hou's avatar martin hou

fix: 消息触发时增加耗时输出

parent 299854b1
...@@ -342,6 +342,7 @@ function Jensen(log, conn) { ...@@ -342,6 +342,7 @@ function Jensen(log, conn) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
actions[tag] = { actions[tag] = {
tag: tag, tag: tag,
createtime: new Date().getTime(),
resolve: resolve, resolve: resolve,
reject: reject, reject: reject,
timeout: t timeout: t
...@@ -369,6 +370,7 @@ function Jensen(log, conn) { ...@@ -369,6 +370,7 @@ function Jensen(log, conn) {
let p = actions[current]; let p = actions[current];
if (p.timeout) clearTimeout(p.timeout); if (p.timeout) clearTimeout(p.timeout);
p.resolve(resp); p.resolve(resp);
Logger.info('jensen', 'trigger', tag + ', cost: ' + (new Date().getTime() - p.createTime) + 'ms');
delete actions[current]; delete actions[current];
current = null; current = null;
}; };
......
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