lint_changes

This commit is contained in:
pedro-php 2025-05-29 10:15:09 -03:00
parent 98b245c7a3
commit 8ab198fe9e
5 changed files with 22 additions and 20 deletions

View File

@ -181,13 +181,13 @@ WEBHOOK_EVENTS_ERRORS=false
WEBHOOK_EVENTS_ERRORS_WEBHOOK= WEBHOOK_EVENTS_ERRORS_WEBHOOK=
# Name that will be displayed on smartphone connection # Name that will be displayed on smartphone connection
CONFIG_SESSION_PHONE_CLIENT=Evolution API CONFIG_SESSION_PHONE_CLIENT='Whizapp'
# Browser Name = Chrome | Firefox | Edge | Opera | Safari # Browser Name = Chrome | Firefox | Edge | Opera | Safari
CONFIG_SESSION_PHONE_NAME=Chrome CONFIG_SESSION_PHONE_NAME=Chrome
# Whatsapp Web version for baileys channel # Whatsapp Web version for baileys channel
# https://web.whatsapp.com/check-update?version=0&platform=web # https://web.whatsapp.com/check-update?version=0&platform=web
CONFIG_SESSION_PHONE_VERSION=2.3000.1015901307 CONFIG_SESSION_PHONE_VERSION=2.3000.1023005435
# Set qrcode display limit # Set qrcode display limit
QRCODE_LIMIT=30 QRCODE_LIMIT=30
@ -220,7 +220,7 @@ DIFY_ENABLED=false
# Cache - Environment variables # Cache - Environment variables
# Redis Cache enabled # Redis Cache enabled
CACHE_REDIS_ENABLED=true CACHE_REDIS_ENABLED=true
CACHE_REDIS_URI=redis://localhost:6379/6 CACHE_REDIS_URI=redis://redis:6379/6
CACHE_REDIS_TTL=604800 CACHE_REDIS_TTL=604800
# Prefix serves to differentiate data from one installation to another that are using the same redis # Prefix serves to differentiate data from one installation to another that are using the same redis
CACHE_REDIS_PREFIX_KEY=evolution CACHE_REDIS_PREFIX_KEY=evolution

View File

@ -2,7 +2,7 @@ services:
api: api:
container_name: evolution_api_${ENVIROMNENT} container_name: evolution_api_${ENVIROMNENT}
build: . build: .
image: adaptweb/evolution-api:1.3.0 image: adaptweb/evolution-api:1.5.0
restart: always restart: always
depends_on: depends_on:
- redis - redis

View File

@ -383,7 +383,7 @@ export class BaileysStartupService extends ChannelStartupService {
qrcodeTerminal.generate(qr, { small: true }, (qrcode) => qrcodeTerminal.generate(qr, { small: true }, (qrcode) =>
this.logger.log( this.logger.log(
`\n{ instance: ${this.instance.name} pairingCode: ${this.instance.qrcode.pairingCode}, qrcodeCount: ${this.instance.qrcode.count} }\n` + `\n{ instance: ${this.instance.name} pairingCode: ${this.instance.qrcode.pairingCode}, qrcodeCount: ${this.instance.qrcode.count} }\n` +
qrcode, qrcode,
), ),
); );
@ -1024,18 +1024,18 @@ export class BaileysStartupService extends ChannelStartupService {
const messagesRepository: Set<string> = new Set( const messagesRepository: Set<string> = new Set(
chatwootImport.getRepositoryMessagesCache(instance) ?? chatwootImport.getRepositoryMessagesCache(instance) ??
( (
await this.prismaRepository.message.findMany({ await this.prismaRepository.message.findMany({
select: { key: true }, select: { key: true },
where: { instanceId: this.instanceId }, where: { instanceId: this.instanceId },
}) })
).map((message) => { ).map((message) => {
const key = message.key as { const key = message.key as {
id: string; id: string;
}; };
return key.id; return key.id;
}), }),
); );
if (chatwootImport.getRepositoryMessagesCache(instance) === null) { if (chatwootImport.getRepositoryMessagesCache(instance) === null) {
@ -1653,10 +1653,12 @@ export class BaileysStartupService extends ChannelStartupService {
private readonly groupHandler = { private readonly groupHandler = {
'groups.upsert': (groupMetadata: GroupMetadata[]) => { 'groups.upsert': (groupMetadata: GroupMetadata[]) => {
console.dir(groupMetadata, { depth: null });
this.sendDataWebhook(Events.GROUPS_UPSERT, groupMetadata); this.sendDataWebhook(Events.GROUPS_UPSERT, groupMetadata);
}, },
'groups.update': (groupMetadataUpdate: Partial<GroupMetadata>[]) => { 'groups.update': (groupMetadataUpdate: Partial<GroupMetadata>[]) => {
console.dir(groupMetadataUpdate, { depth: null });
this.sendDataWebhook(Events.GROUPS_UPDATE, groupMetadataUpdate); this.sendDataWebhook(Events.GROUPS_UPDATE, groupMetadataUpdate);
groupMetadataUpdate.forEach((group) => { groupMetadataUpdate.forEach((group) => {
@ -1671,6 +1673,7 @@ export class BaileysStartupService extends ChannelStartupService {
participants: string[]; participants: string[];
action: ParticipantAction; action: ParticipantAction;
}) => { }) => {
console.dir(participantsUpdate, { depth: null })
this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate);
this.updateGroupMetadataCache(participantsUpdate.id); this.updateGroupMetadataCache(participantsUpdate.id);

View File

@ -30,7 +30,7 @@ class Redis {
}); });
this.client.on('error', () => { this.client.on('error', () => {
this.logger.error('redis disconnected'); this.logger.error(`redis disconnected, URI:${this.conf.URI}`);
this.connected = false; this.connected = false;
}); });
@ -40,7 +40,7 @@ class Redis {
}); });
try { try {
this.client.connect(); this.client.connect().then(()=> {this.logger.verbose("Attempting redis connection")});
this.connected = true; this.connected = true;
} catch (e) { } catch (e) {
this.connected = false; this.connected = false;

View File

@ -152,11 +152,10 @@ async function bootstrap() {
logger.info('Server closed, exiting...'); logger.info('Server closed, exiting...');
process.exit(0); process.exit(0);
}); });
setTimeout(() => { setTimeout(() => {
logger.error('Could not close connections in time, forcefully exiting'); logger.error('Could not close connections in time, forcefully exiting');
process.exit(1); process.exit(1);
}, 30000); }, 60000);
}); });
} }