From 7916ac028f440708d6003f4934e5a30ad3d47a11 Mon Sep 17 00:00:00 2001 From: mybios Date: Sat, 31 Aug 2024 13:05:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B6=85=E6=97=B6=E7=9A=84ms?= =?UTF-8?q?g=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/pinus-rpc/lib/rpc-client/mailboxes/mqtt-mailbox.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/pinus-rpc/lib/rpc-client/mailboxes/mqtt-mailbox.ts b/packages/pinus-rpc/lib/rpc-client/mailboxes/mqtt-mailbox.ts index 2d6dd6a68..282248d6b 100644 --- a/packages/pinus-rpc/lib/rpc-client/mailboxes/mqtt-mailbox.ts +++ b/packages/pinus-rpc/lib/rpc-client/mailboxes/mqtt-mailbox.ts @@ -176,7 +176,7 @@ export class MailBox extends EventEmitter implements IMailBox { let id = this.curId++; this.requests[id] = cb; - this.setCbTimeout( id, tracer, cb); + this.setCbTimeout( id, msg, tracer, cb); let pkg: any; if (tracer && tracer.isEnabled) { @@ -270,14 +270,14 @@ export class MailBox extends EventEmitter implements IMailBox { cb(tracer, sendErr, pkgResp); } - setCbTimeout(id: number, tracer: any, cb: Function) { + setCbTimeout(id: number, msg: MailBoxMessage, tracer: any, cb: Function) { let timer = setTimeout( () => { // logger.warn('rpc request is timeout, id: %s, host: %s, port: %s', id, this.host, this.port); this.clearCbTimeout(id); if (this.requests[id]) { delete this.requests[id]; } - let eMsg = util.format('rpc %s callback timeout %d, remote server %s host: %s, port: %s', this.serverId, this.timeoutValue, id, this.host, this.port); + let eMsg = util.format('rpc %s callback timeout %d, remote server %s host: %s, port: %s, msg: %s', this.serverId, this.timeoutValue, id, this.host, this.port, JSON.stringify(msg)); logger.error(eMsg); cb(tracer, new Error(eMsg)); }, this.timeoutValue);