mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-24 17:38:40 -06:00
feat: Added rabbitmq to send events
This commit is contained in:
parent
f1571b5f66
commit
56d621bab8
@ -27,7 +27,7 @@ export const initAMQP = () => {
|
|||||||
channel.assertExchange(exchangeName, 'topic', { durable: false });
|
channel.assertExchange(exchangeName, 'topic', { durable: false });
|
||||||
amqpChannel = channel;
|
amqpChannel = channel;
|
||||||
|
|
||||||
logger.log('AMQP initialized');
|
logger.info('AMQP initialized');
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -11,7 +11,6 @@ let io: SocketIO;
|
|||||||
const cors = configService.get<Cors>('CORS').ORIGIN;
|
const cors = configService.get<Cors>('CORS').ORIGIN;
|
||||||
|
|
||||||
export const initIO = (httpServer: Server) => {
|
export const initIO = (httpServer: Server) => {
|
||||||
logger.verbose('Initializing Socket.io');
|
|
||||||
io = new SocketIO(httpServer, {
|
io = new SocketIO(httpServer, {
|
||||||
cors: {
|
cors: {
|
||||||
origin: cors,
|
origin: cors,
|
||||||
@ -19,12 +18,14 @@ export const initIO = (httpServer: Server) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
io.on('connection', (socket) => {
|
io.on('connection', (socket) => {
|
||||||
logger.verbose('Client connected');
|
logger.info('User connected');
|
||||||
|
|
||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
logger.verbose('Client disconnected');
|
logger.info('User disconnected');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
logger.info('Socket.io initialized');
|
||||||
return io;
|
return io;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user