mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-08-29 10:46:11 -06:00
fix: create rabbitmq queues on set config
This commit is contained in:
parent
3ea454c7ed
commit
6eda556242
@ -44,7 +44,7 @@ export const getAMQP = (): amqp.Channel | null => {
|
|||||||
|
|
||||||
export const initQueues = (instanceName: string, events: string[]) => {
|
export const initQueues = (instanceName: string, events: string[]) => {
|
||||||
console.log('initQueues', instanceName, events);
|
console.log('initQueues', instanceName, events);
|
||||||
if (!events.length) return;
|
if (!events || !events.length) return;
|
||||||
|
|
||||||
const queues = events.map((event) => {
|
const queues = events.map((event) => {
|
||||||
return `${event.replace(/_/g, '.').toLowerCase()}`;
|
return `${event.replace(/_/g, '.').toLowerCase()}`;
|
||||||
|
@ -229,7 +229,7 @@ export class InstanceController {
|
|||||||
'CHAMA_AI_ACTION',
|
'CHAMA_AI_ACTION',
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
newEvents = events;
|
newEvents = rabbitmq_events;
|
||||||
}
|
}
|
||||||
this.rabbitmqService.create(instance, {
|
this.rabbitmqService.create(instance, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -237,8 +237,6 @@ export class InstanceController {
|
|||||||
});
|
});
|
||||||
|
|
||||||
rabbitmqEvents = (await this.rabbitmqService.find(instance)).events;
|
rabbitmqEvents = (await this.rabbitmqService.find(instance)).events;
|
||||||
|
|
||||||
initQueues(instance.instanceName, rabbitmqEvents);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.logger.log(error);
|
this.logger.log(error);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user