mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
chore: mutex upsertMessage call from sendMessage
This commit is contained in:
@@ -20,6 +20,7 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
const {
|
||||
ev,
|
||||
authState,
|
||||
processingMutex,
|
||||
upsertMessage,
|
||||
query,
|
||||
fetchPrivacySettings,
|
||||
@@ -649,7 +650,9 @@ export const makeMessagesSocket = (config: SocketConfig) => {
|
||||
await relayMessage(jid, fullMsg.message!, { messageId: fullMsg.key.id!, cachedGroupMetadata: options.cachedGroupMetadata, additionalAttributes })
|
||||
if(config.emitOwnEvents) {
|
||||
process.nextTick(() => {
|
||||
upsertMessage(fullMsg, 'append')
|
||||
processingMutex.mutex(() => (
|
||||
upsertMessage(fullMsg, 'append')
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user