@seidor-cloud-produtos/orbit-backend-lib 2.0.123 → 2.0.125

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.
@@ -31,6 +31,7 @@ export default class AmqpQueue implements QueueConnection {
31
31
  private static instance;
32
32
  private vHost;
33
33
  private connection;
34
+ private isReconnecting;
34
35
  private messagesInMemory;
35
36
  private channels;
36
37
  protected socketOptions?: SocketOptions;
@@ -20,6 +20,7 @@ class AmqpQueue {
20
20
  static instance;
21
21
  vHost;
22
22
  connection;
23
+ isReconnecting = false;
23
24
  messagesInMemory = [];
24
25
  channels = new Map();
25
26
  socketOptions;
@@ -34,7 +35,6 @@ class AmqpQueue {
34
35
  setSocketOptions(socketOptions) {
35
36
  this.socketOptions = {
36
37
  maxStoredMessagesOnError: 500,
37
- heartbeat: 60,
38
38
  ...(socketOptions || {}),
39
39
  };
40
40
  return this;
@@ -348,6 +348,10 @@ class AmqpQueue {
348
348
  * reconectar, reativa consumidores e reenvia mensagens em memória.
349
349
  */
350
350
  async treatReconnection(vHost) {
351
+ if (this.isReconnecting) {
352
+ return;
353
+ }
354
+ this.isReconnecting = true;
351
355
  this.logger.info('⛔ Connection Error!!');
352
356
  this.logger.info(`🔄 Try connection to the vHost ${vHost}`);
353
357
  await this.connect(vHost);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.123",
3
+ "version": "2.0.125",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",