Skip to content

Commit 2e6bf88

Browse files
matheusmartinsInspermatheusmartinsInsper
authored andcommitted
feat: Add NATS integration and update Baileys service
- Create Nats table in PostgreSQL migration - Disable message recovery logic in Baileys service - Remove console log in instance creation route
1 parent ba4ea0b commit 2e6bf88

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -944,23 +944,23 @@ export class BaileysStartupService extends ChannelStartupService {
944944
}
945945
}
946946

947-
if (received.messageStubParameters && received.messageStubParameters[0] === 'Message absent from node') {
948-
this.logger.info(`Recovering message lost messageId: ${received.key.id}`);
947+
//if (received.messageStubParameters && received.messageStubParameters[0] === 'Message absent from node') {
948+
// this.logger.info(`Recovering message lost messageId: ${received.key.id}`);
949949

950-
await this.baileysCache.set(received.key.id, {
951-
message: received,
952-
retry: 0,
953-
});
950+
// await this.baileysCache.set(received.key.id, {
951+
// message: received,
952+
// retry: 0,
953+
// });
954954

955-
continue;
956-
}
955+
// continue;
956+
//}
957957

958-
const retryCache = (await this.baileysCache.get(received.key.id)) || null;
958+
// const retryCache = (await this.baileysCache.get(received.key.id)) || null;
959959

960-
if (retryCache) {
961-
this.logger.info('Recovered message lost');
962-
await this.baileysCache.delete(received.key.id);
963-
}
960+
// if (retryCache) {
961+
// this.logger.info('Recovered message lost');
962+
// await this.baileysCache.delete(received.key.id);
963+
// }
964964

965965
// Cache to avoid duplicate messages
966966
const messageKey = `${this.instance.id}_${received.key.id}`;

src/api/routes/instance.router.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class InstanceRouter extends RouterBroker {
1515
super();
1616
this.router
1717
.post('/create', ...guards, async (req, res) => {
18-
console.log('create instance', req.body);
1918
const response = await this.dataValidate<InstanceDto>({
2019
request: req,
2120
schema: instanceSchema,

0 commit comments

Comments
 (0)