2
0

🐛 Add max wait block timeout on WhatsApp runtime

This commit is contained in:
Baptiste Arnaud
2024-01-30 09:36:25 +01:00
parent 6215cfbbaf
commit 26872e2bac

View File

@ -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 {