Skip to content

Commit

Permalink
馃悰 Add max wait block timeout on WhatsApp runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Jan 30, 2024
1 parent 6215cfb commit 26872e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bot-engine/whatsapp/sendChatReplyToWhatsApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,10 @@ const executeClientSideAction =
): Promise<{ replyToSend: string | undefined } | void> => {
if ('wait' in clientSideAction) {
await new Promise((resolve) =>
setTimeout(resolve, clientSideAction.wait.secondsToWaitFor * 1000)
setTimeout(
resolve,
Math.min(clientSideAction.wait.secondsToWaitFor, 10) * 1000
)
)
if (!clientSideAction.expectsDedicatedReply) return
return {
Expand Down

0 comments on commit 26872e2

Please sign in to comment.