Skip to content

Commit 2a9412c

Browse files
committed
chore: adjust socket configuration and update baileys version
Updated package.json to include the latest version of baileys for improved functionality. Modified whatsapp.baileys.service.ts to adjust socket configuration, enhancing the stability and performance of the service.
1 parent f707cf4 commit 2a9412c

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"amqplib": "^0.10.3",
5050
"@aws-sdk/client-sqs": "^3.569.0",
5151
"axios": "^1.6.5",
52-
"@whiskeysockets/baileys": "6.7.4",
52+
"@whiskeysockets/baileys": "6.7.5",
5353
"class-validator": "^0.14.1",
5454
"compression": "^1.7.4",
5555
"cors": "^2.8.5",

src/api/services/channels/whatsapp.baileys.service.ts

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -595,9 +595,12 @@ export class BaileysStartupService extends ChannelStartupService {
595595
browser: number ? ['Chrome (Linux)', session.NAME, release()] : browser,
596596
version,
597597
markOnlineOnConnect: this.localSettings.always_online,
598-
retryRequestDelayMs: 10,
599-
connectTimeoutMs: 60_000,
600-
qrTimeout: 40_000,
598+
retryRequestDelayMs: 350,
599+
maxMsgRetryCount: 4,
600+
fireInitQueries: true,
601+
connectTimeoutMs: 20_000,
602+
keepAliveIntervalMs: 30_000,
603+
qrTimeout: 45_000,
601604
defaultQueryTimeoutMs: undefined,
602605
emitOwnEvents: false,
603606
shouldIgnoreJid: (jid) => {
@@ -614,7 +617,7 @@ export class BaileysStartupService extends ChannelStartupService {
614617
return this.historySyncNotification(msg);
615618
},
616619
userDevicesCache: this.userDevicesCache,
617-
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
620+
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
618621
patchMessageBeforeSending(message) {
619622
if (
620623
message.deviceSentMessage?.message?.listMessage?.listType ===
@@ -770,12 +773,16 @@ export class BaileysStartupService extends ChannelStartupService {
770773
},
771774
logger: P({ level: this.logBaileys }),
772775
printQRInTerminal: false,
776+
mobile: this.mobile,
773777
browser: this.phoneNumber ? ['Chrome (Linux)', session.NAME, release()] : browser,
774778
version,
775779
markOnlineOnConnect: this.localSettings.always_online,
776-
retryRequestDelayMs: 10,
777-
connectTimeoutMs: 60_000,
778-
qrTimeout: 40_000,
780+
retryRequestDelayMs: 350,
781+
maxMsgRetryCount: 4,
782+
fireInitQueries: true,
783+
connectTimeoutMs: 20_000,
784+
keepAliveIntervalMs: 30_000,
785+
qrTimeout: 45_000,
779786
defaultQueryTimeoutMs: undefined,
780787
emitOwnEvents: false,
781788
shouldIgnoreJid: (jid) => {
@@ -792,7 +799,7 @@ export class BaileysStartupService extends ChannelStartupService {
792799
return this.historySyncNotification(msg);
793800
},
794801
userDevicesCache: this.userDevicesCache,
795-
transactionOpts: { maxCommitRetries: 10, delayBetweenTriesMs: 10 },
802+
transactionOpts: { maxCommitRetries: 5, delayBetweenTriesMs: 2500 },
796803
patchMessageBeforeSending(message) {
797804
if (
798805
message.deviceSentMessage?.message?.listMessage?.listType ===

0 commit comments

Comments
 (0)