Skip to content

Commit 2791f88

Browse files
committed
fix: added delay in chatwoot receive webhook
1 parent 41bea89 commit 2791f88

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/whatsapp/services/chatwoot.service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,9 @@ export class ChatwootService {
945945

946946
public async receiveWebhook(instance: InstanceDto, body: any) {
947947
try {
948+
// espera 500ms para evitar duplicidade de mensagens
949+
await new Promise((resolve) => setTimeout(resolve, 500));
950+
948951
this.logger.verbose('receive webhook to chatwoot instance: ' + instance.instanceName);
949952
const client = await this.clientCw(instance);
950953

0 commit comments

Comments
 (0)