From aeb936938e024ec2986ef46557a9c5d6df15d31d Mon Sep 17 00:00:00 2001 From: Martin Dimitrov Date: Sun, 27 Oct 2024 12:19:08 -0700 Subject: [PATCH] revert the previous revert and make discord timeout within the twilio function --- packages/doorman-api/functions/common/discord.private.js | 2 +- packages/doorman-client/functions/buzzer-activated.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/doorman-api/functions/common/discord.private.js b/packages/doorman-api/functions/common/discord.private.js index 448b9ee..dccdddf 100644 --- a/packages/doorman-api/functions/common/discord.private.js +++ b/packages/doorman-api/functions/common/discord.private.js @@ -11,7 +11,7 @@ exports.getDiscordClient = async (context) => { const client = new Client({ intents: [GatewayIntentBits.DirectMessages], rest: { - timeout: 60_000, // 1 minute + timeout: 8_000, // 8s } }); diff --git a/packages/doorman-client/functions/buzzer-activated.js b/packages/doorman-client/functions/buzzer-activated.js index 6141ddf..f80cfaf 100644 --- a/packages/doorman-client/functions/buzzer-activated.js +++ b/packages/doorman-client/functions/buzzer-activated.js @@ -142,7 +142,7 @@ exports.handler = async function(context, event, callback) { const twiml = await Promise.race([unlockPromise, gracefulFallbackPromise, ungracefulFallbackPromise]); console.log(invokeId, "Race ended, clearing residual timers"); - // timeouts.forEach(timeout => clearTimeout(timeout)); - // intervals.forEach(interval => clearInterval(interval)); + timeouts.forEach(timeout => clearTimeout(timeout)); + intervals.forEach(interval => clearInterval(interval)); callback(null, twiml); };