@azteam/rabbitmq-async 1.0.170 → 1.0.172

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.
@@ -163,14 +163,14 @@ var RabbitMQAsync = /*#__PURE__*/function () {
163
163
  key: "parsePrefix",
164
164
  value: function parsePrefix(name) {
165
165
  var self = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
166
+ var newName = name;
166
167
  if (self) {
167
- // eslint-disable-next-line no-param-reassign
168
- name = "".concat(this.serverIp, "_").concat(name);
168
+ newName = "".concat(this.serverIp, "_").concat(newName);
169
169
  }
170
170
  if (this.prefix) {
171
- return "".concat(this.prefix, ":").concat(name);
171
+ newName = "".concat(this.prefix, ":").concat(newName);
172
172
  }
173
- return name;
173
+ return newName;
174
174
  }
175
175
  }, {
176
176
  key: "send",
@@ -380,7 +380,7 @@ var RabbitMQAsync = /*#__PURE__*/function () {
380
380
  _context6.next = 16;
381
381
  break;
382
382
  }
383
- if (!(messageQueue.worker && !queueName.startsWith(messageQueue.serverIp))) {
383
+ if (!messageQueue.worker) {
384
384
  _context6.next = 12;
385
385
  break;
386
386
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/rabbitmq-async",
3
- "version": "1.0.170",
3
+ "version": "1.0.172",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "toda",
@@ -66,15 +66,14 @@ class RabbitMQAsync {
66
66
  }
67
67
 
68
68
  parsePrefix(name, self = false) {
69
+ let newName = name;
69
70
  if (self) {
70
- // eslint-disable-next-line no-param-reassign
71
- name = `${this.serverIp}_${name}`;
71
+ newName = `${this.serverIp}_${newName}`;
72
72
  }
73
-
74
73
  if (this.prefix) {
75
- return `${this.prefix}:${name}`;
74
+ newName = `${this.prefix}:${newName}`;
76
75
  }
77
- return name;
76
+ return newName;
78
77
  }
79
78
 
80
79
  async send(queueName, msg = {}, limit = 0) {
@@ -157,7 +156,7 @@ class RabbitMQAsync {
157
156
  if (msg.fields.redelivered) {
158
157
  data.retry -= 1;
159
158
  if (data.retry > 0) {
160
- if (messageQueue.worker && !queueName.startsWith(messageQueue.serverIp)) {
159
+ if (messageQueue.worker) {
161
160
  await messageQueue.send(queueName, {
162
161
  ...data,
163
162
  self: true,