@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.
|
@@ -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);
|