Merge branch 'release/1.7.0'

This commit is contained in:
Davidson Gomes 2024-03-27 14:26:03 -03:00
commit 43bdbf1018
2 changed files with 5 additions and 5 deletions

View File

@ -10,7 +10,6 @@ let amqpChannel: amqp.Channel | null = null;
export const initAMQP = () => {
return new Promise<void>((resolve, reject) => {
const uri = configService.get<Rabbitmq>('RABBITMQ').URI;
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? 'evolution_exchange';
amqp.connect(uri, (error, connection) => {
if (error) {
reject(error);
@ -23,6 +22,8 @@ export const initAMQP = () => {
return;
}
const exchangeName = 'evolution_exchange';
channel.assertExchange(exchangeName, 'topic', {
durable: true,
autoDelete: false,
@ -50,7 +51,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
queues.forEach((event) => {
const amqp = getAMQP();
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? instanceName;
const exchangeName = instanceName ?? 'evolution_exchange';
amqp.assertExchange(exchangeName, 'topic', {
durable: true,
@ -80,7 +81,7 @@ export const removeQueues = (instanceName: string, events: string[]) => {
return `${event.replace(/_/g, '.').toLowerCase()}`;
});
const exchangeName = configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? instanceName;
const exchangeName = instanceName ?? 'evolution_exchange';
queues.forEach((event) => {
const amqp = getAMQP();

View File

@ -13,7 +13,6 @@ import {
Database,
HttpServer,
Log,
Rabbitmq,
Sqs,
Webhook,
Websocket,
@ -686,7 +685,7 @@ export class WAStartupService {
if (amqp) {
if (Array.isArray(rabbitmqLocal) && rabbitmqLocal.includes(we)) {
const exchangeName = this.configService.get<Rabbitmq>('RABBITMQ').EXCHANGE_NAME ?? this.instanceName;
const exchangeName = this.instanceName ?? 'evolution_exchange';
amqp.assertExchange(exchangeName, 'topic', {
durable: true,