mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-23 04:22:02 -06:00
fix: exchange rabbitmq
This commit is contained in:
parent
3ccb983377
commit
d8ce23f2a0
@ -27,6 +27,7 @@ export const initAMQP = () => {
|
||||
channel.assertExchange(exchangeName, 'topic', {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
assert: true,
|
||||
});
|
||||
|
||||
amqpChannel = channel;
|
||||
@ -43,7 +44,7 @@ export const getAMQP = (): amqp.Channel | null => {
|
||||
};
|
||||
|
||||
export const initQueues = (instanceName: string, events: string[]) => {
|
||||
if (!events || !events.length) return;
|
||||
if (!instanceName || !events || !events.length) return;
|
||||
|
||||
const queues = events.map((event) => {
|
||||
return `${event.replace(/_/g, '.').toLowerCase()}`;
|
||||
@ -56,6 +57,7 @@ export const initQueues = (instanceName: string, events: string[]) => {
|
||||
amqp.assertExchange(exchangeName, 'topic', {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
assert: true,
|
||||
});
|
||||
|
||||
const queueName = `${instanceName}.${event}`;
|
||||
@ -89,6 +91,7 @@ export const removeQueues = (instanceName: string, events: string[]) => {
|
||||
amqp.assertExchange(exchangeName, 'topic', {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
assert: true,
|
||||
});
|
||||
|
||||
const queueName = `${instanceName}.${event}`;
|
||||
|
@ -779,6 +779,7 @@ export class WAStartupService {
|
||||
amqp.assertExchange(exchangeName, 'topic', {
|
||||
durable: true,
|
||||
autoDelete: false,
|
||||
assert: true,
|
||||
});
|
||||
|
||||
const queueName = `${this.instanceName}.${event}`;
|
||||
|
Loading…
Reference in New Issue
Block a user