@autofleet/rabbit 2.2.7 → 2.2.8

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.
package/dist/index.d.ts CHANGED
@@ -35,7 +35,7 @@ interface ConsumeOptions {
35
35
  }
36
36
  declare type CallbackFunction = (msg: ConsumeMessage, ack: Function, nack: Function) => Promise<any>;
37
37
  export interface AfRabbitOptions {
38
- reconnect: boolean;
38
+ disableReconnect: boolean;
39
39
  }
40
40
  declare class RabbitMq implements IAfRabbitMq {
41
41
  static parseMsg(msg: any): any;
package/dist/index.js CHANGED
@@ -145,12 +145,12 @@ class RabbitMq {
145
145
  var _a;
146
146
  this.exchanges = {};
147
147
  this.queues = {};
148
- if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.reconnect) {
149
- logger_1.default.error(`${this.RESCONNECT_MSG}${err && ` - ${err}`}`);
150
- this.connection = null;
148
+ if ((_a = this.options) === null || _a === void 0 ? void 0 : _a.disableReconnect) {
149
+ logger_1.default.error(`${this.DISCONNECT_MSG}${err && ` - ${err}`}`);
151
150
  }
152
151
  else {
153
- logger_1.default.error(`${this.DISCONNECT_MSG}${err && ` - ${err}`}`);
152
+ logger_1.default.error(`${this.RESCONNECT_MSG}${err && ` - ${err}`}`);
153
+ this.connection = null;
154
154
  }
155
155
  });
156
156
  this.creatingConnection = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autofleet/rabbit",
3
- "version": "2.2.7",
3
+ "version": "2.2.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
package/src/index.ts CHANGED
@@ -49,7 +49,7 @@ interface ConsumeOptions {
49
49
  type CallbackFunction = (msg: ConsumeMessage, ack: Function, nack: Function) => Promise<any>
50
50
 
51
51
  export interface AfRabbitOptions {
52
- reconnect: boolean;
52
+ disableReconnect: boolean;
53
53
  }
54
54
 
55
55
  const DEFAULT_DEAD_TTL_TWO_DAYS = 60000 * 60 * 48;
@@ -224,11 +224,11 @@ class RabbitMq implements IAfRabbitMq {
224
224
  ({ err }) => {
225
225
  this.exchanges = {};
226
226
  this.queues = {};
227
- if (this.options?.reconnect) {
227
+ if (this.options?.disableReconnect) {
228
+ logger.error(`${this.DISCONNECT_MSG}${err && ` - ${err}`}`);
229
+ } else {
228
230
  logger.error(`${this.RESCONNECT_MSG}${err && ` - ${err}`}`);
229
231
  this.connection = null;
230
- } else {
231
- logger.error(`${this.DISCONNECT_MSG}${err && ` - ${err}`}`);
232
232
  }
233
233
  });
234
234
  this.creatingConnection = false;