Skip to content

Commit

Permalink
fix: adjust settings in whatsapp.baileys.service.ts
Browse files Browse the repository at this point in the history
Increased retryRequestDelayMs, added maxMsgRetryCount, and updated connectTimeoutMs and qrTimeout values for better performance. Adjusted transactionOpts for more efficient retries. These changes aim to enhance connection stability and message handling efficiency.
  • Loading branch information
DavidsonGomes committed Jun 12, 2024
1 parent 7799e66 commit f1c31a7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/api/services/channels/whatsapp.baileys.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,12 @@ export class BaileysStartupService extends ChannelStartupService {
browser: number ? ['Chrome (Linux)', session.NAME, release()] : browser,
version,
markOnlineOnConnect: this.localSettings.alwaysOnline,
retryRequestDelayMs: 10,
connectTimeoutMs: 60_000,
qrTimeout: 40_000,
retryRequestDelayMs: 350,
maxMsgRetryCount: 4,
fireInitQueries: true,
connectTimeoutMs: 20_000,
keepAliveIntervalMs: 30_000,
qrTimeout: 45_000,
defaultQueryTimeoutMs: undefined,
emitOwnEvents: false,
shouldIgnoreJid: (jid) => {
Expand All @@ -597,7 +600,7 @@ export class BaileysStartupService extends ChannelStartupService {
return this.historySyncNotification(msg);
},
userDevicesCache: this.userDevicesCache,
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
patchMessageBeforeSending(message) {
if (
message.deviceSentMessage?.message?.listMessage?.listType ===
Expand Down Expand Up @@ -704,9 +707,12 @@ export class BaileysStartupService extends ChannelStartupService {
browser: this.phoneNumber ? ['Chrome (Linux)', session.NAME, release()] : browser,
version,
markOnlineOnConnect: this.localSettings.alwaysOnline,
retryRequestDelayMs: 10,
connectTimeoutMs: 60_000,
qrTimeout: 40_000,
retryRequestDelayMs: 350,
maxMsgRetryCount: 4,
fireInitQueries: true,
connectTimeoutMs: 20_000,
keepAliveIntervalMs: 30_000,
qrTimeout: 45_000,
defaultQueryTimeoutMs: undefined,
emitOwnEvents: false,
shouldIgnoreJid: (jid) => {
Expand All @@ -724,7 +730,7 @@ export class BaileysStartupService extends ChannelStartupService {
return this.historySyncNotification(msg);
},
userDevicesCache: this.userDevicesCache,
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
patchMessageBeforeSending(message) {
if (
message.deviceSentMessage?.message?.listMessage?.listType ===
Expand Down

0 comments on commit f1c31a7

Please sign in to comment.