From 3637b95f8fbc51a863c95d8405fa1aa204ef8ee8 Mon Sep 17 00:00:00 2001 From: Davidson Gomes Date: Wed, 3 Jul 2024 18:35:12 -0300 Subject: [PATCH] chore: Update Dockerfile and whatsapp.baileys.service.ts Update and modifications in Dockerfile and src/api/services/channels/whatsapp.baileys.service.ts files. These changes improve the performance and maintainability of the Node.js project. --- Dockerfile | 4 ++-- src/api/services/channels/whatsapp.baileys.service.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4a9b2c36..f2db602b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /evolution COPY ./package.json ./tsconfig.json ./ -RUN npm install --no-cache +RUN npm install COPY ./src ./src COPY ./public ./public @@ -39,7 +39,7 @@ WORKDIR /evolution COPY --from=builder /evolution/package.json ./package.json COPY --from=builder /evolution/package-lock.json ./package-lock.json -RUN npm install --omit=dev --no-cache +RUN npm install --omit=dev COPY --from=builder /evolution/dist ./dist COPY --from=builder /evolution/prisma ./prisma diff --git a/src/api/services/channels/whatsapp.baileys.service.ts b/src/api/services/channels/whatsapp.baileys.service.ts index 668dc9d5..e4fe38d7 100644 --- a/src/api/services/channels/whatsapp.baileys.service.ts +++ b/src/api/services/channels/whatsapp.baileys.service.ts @@ -592,7 +592,7 @@ export class BaileysStartupService extends ChannelStartupService { }, logger: P({ level: this.logBaileys }), printQRInTerminal: false, - // ...browserOptions, + ...browserOptions, version, markOnlineOnConnect: this.localSettings.alwaysOnline, retryRequestDelayMs: 350, @@ -601,7 +601,6 @@ export class BaileysStartupService extends ChannelStartupService { connectTimeoutMs: 20_000, keepAliveIntervalMs: 30_000, qrTimeout: 45_000, - // defaultQueryTimeoutMs: undefined, emitOwnEvents: false, shouldIgnoreJid: (jid) => { const isGroupJid = this.localSettings.groupsIgnore && isJidGroup(jid); @@ -618,7 +617,7 @@ export class BaileysStartupService extends ChannelStartupService { return this.historySyncNotification(msg); }, userDevicesCache: this.userDevicesCache, - transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 }, + transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 3000 }, patchMessageBeforeSending(message) { if ( message.deviceSentMessage?.message?.listMessage?.listType === proto.Message.ListMessage.ListType.PRODUCT_LIST