mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: increase app state sync timeout
This commit is contained in:
@@ -9,6 +9,8 @@ import { areJidsSameUser, BinaryNode, BinaryNodeAttributes, getAllBinaryNodeChil
|
|||||||
import { makeChatsSocket } from './chats'
|
import { makeChatsSocket } from './chats'
|
||||||
import { extractGroupMetadata } from './groups'
|
import { extractGroupMetadata } from './groups'
|
||||||
|
|
||||||
|
const APP_STATE_SYNC_TIMEOUT_MS = 10_000
|
||||||
|
|
||||||
export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
||||||
const {
|
const {
|
||||||
logger,
|
logger,
|
||||||
@@ -38,11 +40,12 @@ export const makeMessagesRecvSocket = (config: SocketConfig) => {
|
|||||||
/** this mutex ensures that each retryRequest will wait for the previous one to finish */
|
/** this mutex ensures that each retryRequest will wait for the previous one to finish */
|
||||||
const retryMutex = makeMutex()
|
const retryMutex = makeMutex()
|
||||||
|
|
||||||
|
/** cache to ensure new history sync events do not have duplicate items */
|
||||||
const historyCache = new Set<string>()
|
const historyCache = new Set<string>()
|
||||||
let recvChats: InitialReceivedChatsState = { }
|
let recvChats: InitialReceivedChatsState = { }
|
||||||
|
|
||||||
const appStateSyncTimeout = debouncedTimeout(
|
const appStateSyncTimeout = debouncedTimeout(
|
||||||
6_000,
|
APP_STATE_SYNC_TIMEOUT_MS,
|
||||||
async() => {
|
async() => {
|
||||||
logger.info(
|
logger.info(
|
||||||
{ recvChats: Object.keys(recvChats).length },
|
{ recvChats: Object.keys(recvChats).length },
|
||||||
|
|||||||
Reference in New Issue
Block a user