egos-transfer 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -511,7 +511,10 @@ class PeerTransfer {
511
511
  // ── Router integration ──────────────────────────────────────────
512
512
  onRequest(conn, message) {
513
513
  return __awaiter(this, void 0, void 0, function* () {
514
- console.info('onRequest===>', message.route);
514
+ var _a;
515
+ if (((_a = this.peerConfig) === null || _a === void 0 ? void 0 : _a.debug) >= 2) {
516
+ console.info('onRequest===>', message.route);
517
+ }
515
518
  // this.resetIdleTimer();
516
519
  try {
517
520
  yield this.router.run(conn, message);
@@ -523,7 +526,10 @@ class PeerTransfer {
523
526
  }
524
527
  onResponse(_conn, message) {
525
528
  return __awaiter(this, void 0, void 0, function* () {
526
- console.info('onResponse<====', message.route);
529
+ var _a;
530
+ if (((_a = this.peerConfig) === null || _a === void 0 ? void 0 : _a.debug) >= 2) {
531
+ console.info('onResponse<====', message.route);
532
+ }
527
533
  // this.resetIdleTimer();
528
534
  // 优先检查 health check ping 回调
529
535
  const cb = this.requests.get(message.requestId);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "egos-transfer",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "1234",
5
5
  "homepage": "https://github.com/superbogy/peer-transfer#readme",
6
6
  "bugs": {
@@ -605,7 +605,10 @@ export abstract class PeerTransfer {
605
605
  // ── Router integration ──────────────────────────────────────────
606
606
 
607
607
  async onRequest(conn: DataConnection, message: PeerMessage) {
608
- console.info('onRequest===>', message.route);
608
+ if (this.peerConfig?.debug >= 2) {
609
+ console.info('onRequest===>', message.route);
610
+ }
611
+
609
612
  // this.resetIdleTimer();
610
613
  try {
611
614
  await this.router.run(conn, message);
@@ -615,7 +618,10 @@ export abstract class PeerTransfer {
615
618
  }
616
619
 
617
620
  async onResponse(_conn: DataConnection, message: PeerMessage) {
618
- console.info('onResponse<====', message.route);
621
+ if (this.peerConfig?.debug >= 2) {
622
+ console.info('onResponse<====', message.route);
623
+ }
624
+
619
625
  // this.resetIdleTimer();
620
626
  // 优先检查 health check ping 回调
621
627
  const cb = this.requests.get(message.requestId);