diff --git a/.env.example b/.env.example index bec0523f..3b580a99 100644 --- a/.env.example +++ b/.env.example @@ -181,13 +181,13 @@ WEBHOOK_EVENTS_ERRORS=false WEBHOOK_EVENTS_ERRORS_WEBHOOK= # 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 CONFIG_SESSION_PHONE_NAME=Chrome # Whatsapp Web version for baileys channel # 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 QRCODE_LIMIT=30 @@ -220,7 +220,7 @@ DIFY_ENABLED=false # Cache - Environment variables # Redis Cache enabled CACHE_REDIS_ENABLED=true -CACHE_REDIS_URI=redis://localhost:6379/6 +CACHE_REDIS_URI=redis://redis:6379/6 CACHE_REDIS_TTL=604800 # Prefix serves to differentiate data from one installation to another that are using the same redis CACHE_REDIS_PREFIX_KEY=evolution diff --git a/docker-compose.yaml b/docker-compose.yaml index 1d55e8aa..cd661d56 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,7 +2,7 @@ services: api: container_name: evolution_api_${ENVIROMNENT} build: . - image: adaptweb/evolution-api:1.3.0 + image: adaptweb/evolution-api:1.5.0 restart: always depends_on: - redis diff --git a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts index dc775a36..d5fbcc8e 100644 --- a/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts +++ b/src/api/integrations/channel/whatsapp/whatsapp.baileys.service.ts @@ -383,7 +383,7 @@ export class BaileysStartupService extends ChannelStartupService { qrcodeTerminal.generate(qr, { small: true }, (qrcode) => this.logger.log( `\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 = new Set( chatwootImport.getRepositoryMessagesCache(instance) ?? - ( - await this.prismaRepository.message.findMany({ - select: { key: true }, - where: { instanceId: this.instanceId }, - }) - ).map((message) => { - const key = message.key as { - id: string; - }; + ( + await this.prismaRepository.message.findMany({ + select: { key: true }, + where: { instanceId: this.instanceId }, + }) + ).map((message) => { + const key = message.key as { + id: string; + }; - return key.id; - }), + return key.id; + }), ); if (chatwootImport.getRepositoryMessagesCache(instance) === null) { @@ -1653,10 +1653,12 @@ export class BaileysStartupService extends ChannelStartupService { private readonly groupHandler = { 'groups.upsert': (groupMetadata: GroupMetadata[]) => { + console.dir(groupMetadata, { depth: null }); this.sendDataWebhook(Events.GROUPS_UPSERT, groupMetadata); }, 'groups.update': (groupMetadataUpdate: Partial[]) => { + console.dir(groupMetadataUpdate, { depth: null }); this.sendDataWebhook(Events.GROUPS_UPDATE, groupMetadataUpdate); groupMetadataUpdate.forEach((group) => { @@ -1671,6 +1673,7 @@ export class BaileysStartupService extends ChannelStartupService { participants: string[]; action: ParticipantAction; }) => { + console.dir(participantsUpdate, { depth: null }) this.sendDataWebhook(Events.GROUP_PARTICIPANTS_UPDATE, participantsUpdate); this.updateGroupMetadataCache(participantsUpdate.id); diff --git a/src/cache/rediscache.client.ts b/src/cache/rediscache.client.ts index 45a0321f..af5f8f1b 100644 --- a/src/cache/rediscache.client.ts +++ b/src/cache/rediscache.client.ts @@ -30,7 +30,7 @@ class Redis { }); this.client.on('error', () => { - this.logger.error('redis disconnected'); + this.logger.error(`redis disconnected, URI:${this.conf.URI}`); this.connected = false; }); @@ -40,7 +40,7 @@ class Redis { }); try { - this.client.connect(); + this.client.connect().then(()=> {this.logger.verbose("Attempting redis connection")}); this.connected = true; } catch (e) { this.connected = false; diff --git a/src/main.ts b/src/main.ts index c2741e44..110f0f2f 100644 --- a/src/main.ts +++ b/src/main.ts @@ -152,11 +152,10 @@ async function bootstrap() { logger.info('Server closed, exiting...'); process.exit(0); }); - setTimeout(() => { logger.error('Could not close connections in time, forcefully exiting'); process.exit(1); - }, 30000); + }, 60000); }); }